Hi,

       I have a problem in the creation complete handler.



I am using Flash Builder 4.7 (Flex SDK 4.9.1)



When I go to a view  when it is the *firstView* (ie firstView="views.view1"),
the image properties are correct (eg width=768).


[image: Inline image 1]


However, if I go to another view as the firstView (eg firstView="views.view2
")

and then click a button to go to the view1 view, the image properties are
null.

[image: Inline image 2]

Anyone any ideas why this is and how I can correct the problem?



The view1 code is as follows:



<?xml version="1.0" encoding="utf-8"?>

<s:View xmlns:fx="http://ns.adobe.com/mxml/2009";

                    xmlns:s="library://ns.adobe.com/flex/spark" title="meal3
"

                    creationComplete="view1_creationCompleteHandler(event)">


  <fx:Script>

                    <![CDATA[



                              import mx.events.FlexEvent;



                              protected function
 view1_creationCompleteHandler(event:FlexEvent):void

                              {

        trace("Image Width = " + myImage1.bitmapData.width);

                              }



                    ]]>

  </fx:Script>



          <s:Image id="myImage1" source="images/image1.jpg" alpha="0" />



</s:View>
-- 
Philip Medlam

Reply via email to