FORUMS: list search recent posts

removing sound from external swfs when its unload and new swfs is loaded

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
eamon white
removing sound from external swfs when its unload and new swfs is loaded
on May 7, 2012 at 7:26:38 am

I HAVE A buttons that external load swfs files(6buttons). The trouble im having is the swf unloads but and loads the new swf but the audio from the old swf stills plays on top of the swf. can anybody help.

also another question how would u right a function that keep the loader i have from loading until my tween of my buttons movie clip is done?

thanks


Return to posts index

demetri tashie
Re: removing sound from external swfs when its unload and new swfs is loaded
on May 7, 2012 at 4:19:29 pm

eamon,

a) if there are sounds/streams in an external swf, those streams should all be closed before asking to unload that external swf.

as of flash player 10 ( i believe), using 'myLoader.unloadAndStop()' as opposed to just 'myLoader.unload()'
should stop all sounds, stop movieclips, etc.
however, it would be a good practice to still manually close all sounds/streams, and remove all references to it before you unload.

perhaps this can help you:
http://helpx.adobe.com/flash/kb/flash-player-10-action-script.html

b) if you use greensock's excellent TweenLite ( or TweenMax), you can perform a function after a tween has fully finished by using their 'onComplete' parameter. it would look something like this:

//import the GreenSock classes
import com.greensock.*;
import com.greensock.easing.*;

TweenLite.to(nava_mc, 1, {x:58, ease:Back.easeOut, onComplete:onFinishTween});

function onFinishTween():void {
swfLoader1.unloadAndStop();
swfLoader1.load(firstRequest);
}



that would perform the unloading and loading of swfLoader1 only after nava_mc has its x tweened for 1 second to 58 (you'll fill in your actual needs)

i hope that can help

PS: you might need to make sure that your main timeline knows that the loader has loaded an external swf ( with sound,video, its own timeline,etc) and treats it as a movieclip, as opposed to being a loader with just an image(jpg/gif/png) loaded into it.

this would allow asctionscript in the main timeline to call to elements( a videoplayer for example) in the external swf (and tell it to stop playing, for example).

this topic has also been discussed here many times. you can do a search here, or google 'external swf communication' for more information on that.


Return to posts index

eamon white
Re: removing sound from external swfs when its unload and new swfs is loaded
on May 7, 2012 at 8:07:04 pm

How do I close the sound, channel in the extreme swf ? What be the action school that I have to write in each swf for it to close in the main swf ?


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]