<mx:Script>
<![CDATA[
test.content.addEventListener(Event.COMPLETE,doWhateverFunction);
]]>
</mx:Script>
<mx:SWFLoader id="test"/>
you need to add a Listener to the content and not the SWF. try that
----- Original Message ----
From: Pete Miller <[EMAIL PROTECTED]>
To: [email protected]
Sent: Sunday, June 1, 2008 9:16:58 PM
Subject: [flexcoders] SWFLoader doesn't fire complete event
I have problems with getting the 'complete' event to occur in an application
I'm working on, so I wrote this:
<?xml version="1.0" encoding="utf- 8"?>
<mx:Application xmlns:mx="http: //www.adobe. com/2006/ mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.events.*;
import mx.controls. Alert;
public function onComplete() :void {
Alert.show(' Complete! ', '', Alert.OK, this);
}
]]>
</mx:Script>
<mx:SWFLoader source='@Embed( source="deleteme .swf")' complete='onComplet
e()' />
</mx:Application>
This doesn't work either. If I can see the swf on the screen, then why don't I
get the 'complete' event?
P.
________________________________
Keep your kids safer online with Windows Live Family Safety. Help protect your
kids.