Image height and width binding

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Image height and width binding

Justin Mclean

In trying g to solve the image height and width issues I was having the other day I also tried this which also didn’t work as expected.

It looks to me that the heightChange and widthChanged events are not dispatched either after the image loads or when the image is replaced with another one.

Is this a bug?

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx=""

       public function changeImage():void {
           image.src = "";

         <js:ApplicationDataBinding />

       <js:SimpleCSSValuesImpl />

       <js:View width="100%" height="100%">
               <js:VerticalLayout />
               <js:SimpleCSSStyles margin="50" />
           <js:Label text="Here's the ASF logo" />
           <js:Container id="holder" width="520" height="300">
                   <js:SimpleCSSStyles backgroundColor="#333333" />
               <js:Image id="image" src="" x="{(holder.width - image.width)/2}" y="{(holder.height - image.height)/2}" />
           <js:TextButton text="Change Image" click="changeImage()" />