desparate
- Started
- Last post
- 13 Responses
- elee
in desparate need of flash help...
I'm loading a swf with sound embedded in the timeline into another file thusly:
var urlRequest:URLRequest = new URLRequest("animations/ANIM_Test...
var animLoader:Loader = new Loader();
animLoader.load(urlRequest);
addChild(animeLoader);When i do a removeChild(animLoader), the animation disappears, but the sound says and loops endlessly. how can I clear out that sound?
Please shoot me an email ()
If you can help, I'll buy you drinks at Sessions. Top shelf shit, too.
- joyride0
stopAllSounds()
- bcline0
is there any kind of reference to the sound in the swf via Actionscript?
- elee0
stopAllSounds()
joyride
(Aug 8 07, 14:08)Unfortunately, they got rid of that in AS3. The new method, flash.media.SoundMixer.stopAll... stops the sound once, but for some reason it starts back up after the loop has completed
- joyride0
are you sure the loaded movie is removed?
- elee0
is there any kind of reference to the sound in the swf via Actionscript?
bcline
(Aug 8 07, 14:08)No, it's embedded directly into the timeline...does flash automatically create an as reference that's accessible?
- elee0
are you sure the loaded movie is removed?
joyride
(Aug 8 07, 14:13)yeah, both the removeChild and uload methods get rid of the animation but leave the sound
- joyride0
trace before and after the removeChild.
I'm guessing it's still there? Are you doing some sort of transition, then calling the removeChild?
- _salisae_0
desparaging
- neue75_bold0
d'asparagus
- elee0
I'm guessing it's still there?
joyride
(Aug 8 07, 14:18)It's definitely being removed...I threw together an example here, if you look at eric_test.fla, you can see what's going on.
http://www.stillwantmore.com/tem…
About 5 seconds after the clip is unloaded, the sound will loop again
- joyride0
sorry man, don't run cs3 here yet... so i cannot open those.
but it sounds like a normal flash problem with loading in swf and not having them actually removed when you make the remove call
in CS2, i run a swapdepths right before the remove, to regain reference to the object. which will work everytime. so maybe try that, i doubt they fixed that issue
- elee0
I appreciate the effort joyride :)
You're definitely right about AS2, but Flash 9's garbage collector disposes of clips differently, so when you remove a clip, listeners (and apparently sounds) remain until you manually delete them.
Naturally, i found this out 3 hours before a project is due...
- bcline0
your first problem is the way you have it set up, you need to attach the sound dynamically or load it dynamically then use the SoundTransform.stop(); method.