"complete" event.

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of danprimetse
Sent: Wednesday, September 12, 2007 11:01 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] event for mx:image change

 

Hi,

I would like to figure out how to get a notification after an image is
loaded from a source change. I've been trying to see which event gets
fired when I the image changes after I call 

myImage.source = "blah.jpg";

myImage does change (displays blah.jpg) but no event gets fired. I'd
like to get notify for each full load of the image object.

I've tried setting a function for the following events: dataChange,
complete, render but none of them seem to work. Can anyone please
suggest an event I could use?

Sample Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "
layout="absolute" x="-19" y="165">
<mx:Script>
<![CDATA[
private function btnLoadImg_Click():void {
myImage.source = "blah.jpg";
}

private function AlertLoadComplete():void {
Alert.show("Loaded: From which event will this fire?");
}

]]>
</mx:Script>

<mx:Image x="25" y="104" width="192" height="142"
themeColor="#0A0A0A" id="myImage" dataChange="AlertLoadComplete();"/>
<mx:Button x="310" y="118" label="Load Image 1" id="btnLoadImg"/>

</mx:WindowedApplication>

I'm using Flex Builder 3.

Thoughts? Suggestions?

Thanks!

 

Reply via email to