Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unload movie 1

Status
Not open for further replies.

Concussion

Technical User
Jun 17, 2002
21
US
Can I add an unload movie command to this script so it will unload all the movies on the same layer as this one is going to load onto?

Thenervebutton.onPress = function() {
_root.createEmptyMovieClip("empty", 2);
loadMovie("hombru.com/Pictures/The Nerve.swf", "empty");
empty._y = 300;
empty._x = 150;
}

Thanks
 
You don't load external movies on layers but on levels or in holder movie clips, as you're doing here.
usually there's no need to unload a movie if you're loading a new one on the same level or in the same holder movie clip, the new movie will automatically replace the previous one! Regards,

new.gif
 
I am at work right now so I don't have Flash in front of me but I am pretty sure that was the issue I had with the text boxes loading on top of the other. I solved it by adding an unloadMovie command to the button that would move to the next frame and run a script to load the next movie when frame2 was loaded. That was the only way I could get it to work. Maybe I'll take the scripting I got from you guys earlier today and try to apply that when I get home if I have time. I wish I had Flash on my work computer. At least I can still do html and upload to my site with my Linux box at home by connecting remotely from here.

Isn't one of the good things about loadMovie the the fact that you could make the whole site on the first frame and never have to go any further than that if you didn't want to?
 
Not really! You can often build a one frame movie and not necessarely use the loadMovie action. The main advantage (if you can call it that!) of the loadMovie action, is to get something on the screen as fast as possible and only download further content on demand.

I'm pretty sure, that when loading an new external movie on a level where there already was a movie, the previous movie is automatically replaced by the new one. I'll test it now for movie clips, but it would suprise me that it would be any different.

Will keep you posted! Regards,

new.gif
 
Just checked it, and as I first said, loading a new movie in an holder movie clip will replace the previous one, without the need to unload the previous one. In fact there's no reason other than saving memory, to ever unload a movie. If you dont need it anymore (especially if it's on another level), just make it invisible. If ever you do need it again, just remake it visible. Regards,

new.gif
 
Thanks for clearing that up for me, I think I am going to get this loadMovie thing completed like I need to now with a whole lot less confusion. Instead of using several methods I can stick with one.


Thanks again!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top