Skip to main content
Participating Frequently
April 14, 2006
Answered

Problem with unload movie

  • April 14, 2006
  • 9 replies
  • 758 views
Hey,

In my flash movie I am loading a video player into level2... but when I click the button that unloads the movie from level 2... the sound continues to play even though that level has been unloaded... I tried using the stopAllSounds command... but I'm not sure how to tell it to target level2 from level0....

any ideas...

Thanks in advance for any help...

-chess4
This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer Rothrock
And you are sure that you have given the Media playback component the instance name of "Media" because if you have it should work.

Also, please read my posts a bit more carefully. If you are using levels, you should use unloadMovieNum().

Are you sure that the back button is working as well? Add this line just before the stop line.

trace("Back button pressed.");

9 replies

Inspiring
April 18, 2006
The loadMovieNum and unloadMovieNum (notice the word Num at the end) should be used whenever you are using _level. While they will sometimes work with the non-Num versions, it can also cause subtle problems that will make you crazy. So it is good to use the correct version.

Glad that worked out for you. So the big lesson learned is that YOU DO KNOW what you are doing! Have confidence in your code and check for the silly obvious mistakes that we all make from time to time. We have all had the "instance name isn't what we thought, how could that have happened" trouble more than we can count. The trick is to learn from it after the 1000th time!
Participating Frequently
April 18, 2006
It finally works... I had somehow messed up and named it "meedia"


You said I should use this "unloadMovieNum()." instead of "unloadMovie(2);" they both work...

Just curious what the difference is... I just can't tell

Rothrock.... YOU ROCK
RothrockCorrect answer
Inspiring
April 17, 2006
And you are sure that you have given the Media playback component the instance name of "Media" because if you have it should work.

Also, please read my posts a bit more carefully. If you are using levels, you should use unloadMovieNum().

Are you sure that the back button is working as well? Add this line just before the stop line.

trace("Back button pressed.");
Participating Frequently
April 15, 2006
ttt
Participating Frequently
April 14, 2006
I tried this

back.onRelease=function(){
_level2.Media.stop();
unloadMovie(2);
gotoAndPlay(1);
}

but still nothing

the media is on the first frame of the main timeline in the SWF on level2

I'm sorry but I am really a novice at code and mainly do design..

if my code looks retarded please excuse it.

WHAT AM I DOING WRONG???????????

Thanks sooooooo much for your help... you ever have an after FX photoshop or 3dmax question you let me know.
Inspiring
April 14, 2006
Ah. I forgot about using unloadMovie in that way. I think If you are unloading a level you should use unloadMovieNum(2).

To reference any level, you start the reference to object with _levelX (where X is the number of the level.)

_level2.Media.stop()

Should do it, assuming Media is on the main timeline of the swf that is loaded into level 2.
Participating Frequently
April 14, 2006
Also..

Thanks a lot... everyone on this forum is so helpful.. I have learned so much just from reading all the posts..

Inspiring
April 14, 2006
This was such a popular topic a while ago, hard to believe that we haven't seen it for awhile.

If you are playing a video (by video you mean FLV, right?) then you should Media.stop() the video. I don't think stopAllSounds will work since you aren't directly using the Sound class.

If you don't know how to target _level2, how are you unloading it?
Participating Frequently
April 14, 2006
I am using code like this

back.onRelease=function(){
unloadMovie(2);
gotoAndPlay(1);
}


So would I do this??
back.onRelease=function(){
Media.stop(2)
unloadMovie(2);
gotoAndPlay(1);
}

because I need to stop it as well as unload the swf it is playing in on level 2


and yes it is an FLV..