Hi Philip,
Just a heads up all images/attachments are removed so we won't be able to read them. I think the problem you are seeing here is that the "myImage1" hasn't loaded its image yet. You might be better off loading the image manually and listening to an event or I think the spark image control also can listen for the Event.COMPLETE. If you upload the code some where I'll get the example working for you. Cheers Mark From: Philip Medlam [mailto:[email protected]] Sent: 09 July 2013 09:45 To: [email protected] Subject: Image properties problem when view is not a firstView in Flex 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). 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. 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> 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
