Re: [flexcoders] SWFLoader doesn't fire complete event
It shouldn't. @Embed compiles any assets into the application SWF at compiletime, so there's no runtime loading, so no complete event. ___ Joseph Balderson | http://joeflash.ca Flex Flash Platform Developer | Abobe Certified Developer Trainer Author, Professional Flex 3 (coming Winter 2008) Staff Writer, Community MX | http://communitymx.com/author.cfm?cid=4674 Alex Harui wrote: I’d have to double-check, but I don’t think @Embed’s generate a complete event since it isn’t an external asynchronous load. *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Joan Lafferty *Sent:* Sunday, June 01, 2008 8:28 PM *To:* flexcoders@yahoogroups.com *Subject:* RE: [flexcoders] SWFLoader doesn't fire complete event You could also try adding a listener to the SWFLoader for the “complete” event in the initialize or preinitialize event. Since both your complete event and source are defined in mxml, if the source loads really quickly, you probably will miss the event. Try: mx:SWFLoader id=”thisSWF” source='@Embed(source=deleteme.swf)' preinitialize=”thisSWF.addEventListener(‘complete', onComplete)” / *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Pete Miller *Sent:* Sunday, June 01, 2008 7:17 PM *To:* flexcoders@yahoogroups.com *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='onComplete()' / /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. http://www.windowslive.com/family_safety/overview.html?ocid=TXT_TAGLM_WL_Refresh_family_safety_052008 -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[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='onComplete()' / /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. http://www.windowslive.com/family_safety/overview.html?ocid=TXT_TAGLM_WL_Refresh_family_safety_052008
Re: [flexcoders] SWFLoader doesn't fire complete event
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: flexcoders@yahoogroups.com 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.
RE: [flexcoders] SWFLoader doesn't fire complete event
You could also try adding a listener to the SWFLoader for the complete event in the initialize or preinitialize event. Since both your complete event and source are defined in mxml, if the source loads really quickly, you probably will miss the event. Try: mx:SWFLoader id=thisSWF source='@Embed(source=deleteme.swf)' preinitialize=thisSWF.addEventListener('complete', onComplete) / From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Pete Miller Sent: Sunday, June 01, 2008 7:17 PM To: flexcoders@yahoogroups.com 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='onComplete()' / /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. http://www.windowslive.com/family_safety/overview.html?ocid=TXT_TAGLM_W L_Refresh_family_safety_052008
RE: [flexcoders] SWFLoader doesn't fire complete event
I'd have to double-check, but I don't think @Embed's generate a complete event since it isn't an external asynchronous load. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Joan Lafferty Sent: Sunday, June 01, 2008 8:28 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] SWFLoader doesn't fire complete event You could also try adding a listener to the SWFLoader for the complete event in the initialize or preinitialize event. Since both your complete event and source are defined in mxml, if the source loads really quickly, you probably will miss the event. Try: mx:SWFLoader id=thisSWF source='@Embed(source=deleteme.swf)' preinitialize=thisSWF.addEventListener('complete', onComplete) / From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Pete Miller Sent: Sunday, June 01, 2008 7:17 PM To: flexcoders@yahoogroups.com 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='onComplete()' / /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. http://www.windowslive.com/family_safety/overview.html?ocid=TXT_TAGLM_W L_Refresh_family_safety_052008