Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flex > Flex 2, 3 & 4

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-07-2011, 11:25 AM   #1
umesh8965
Registered User
 
Join Date: Dec 2010
Posts: 47
Default SWF unload

hi friends

here my flex code....

[Embed(source="1.swf")]
private var _src_a:Class;
[Embed(source="2.swf")]
private var _src_b:Class;

import mx.controls.SWFLoader;
private var f:SWFLoader;
protected function checkBtn_clickHandler(event:MouseEvent):void
{
clear();
f = new SWFLoader();
f.load(_src_a);
_swf.addChild(f);
}
protected function critcalBtn_clickHandler(event:MouseEvent):void
{
clear();
f = new SWFLoader();
f.load(_src_b);
_swf.addChild(f);
}
protected function clear():void
{
//f.unloadAndStop();
//f.source="";
//f.load(null);
_swf.removeAllChildren();
flash.media.SoundMixer.stopAll();
}



<mx:Button id="checkBtn" label="first" click="checkBtn_clickHandler(event)"/>
<mx:Button id="critcalBtn" label="second" click="critcalBtn_clickHandler(event)"/>
<mx:Canvas id="_swf">

</mx:Canvas>


i have 2 swf which i embed in flex code now i chnage my swf from button click my problem is that i Forces the SWFloader to try to unload swf when other swf load, At this point sound from the first loaded SWF is still playing.

help me!!

Last edited by umesh8965; 10-07-2011 at 11:30 AM.
umesh8965 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:41 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.