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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to unload a movie not loaded in by loadMovie() ?

Status
Not open for further replies.

Bimmel

Programmer
Feb 15, 2002
19
DE
I have a movie clip in my file I do not want anymore after 100 loops.
When I go into the reference, it is said I only can unload movies that were loaded with loadMovie() function.
So what should I do?
It is not sufficient to just put the visibilty to 0.
This movie do some actions I really admire to kick.

btw: onClipEvent( enterFrame ) <- I thought this event cannot be provoked when I stop the animation within the movie
 
I have not used this myself but here is the code for removing a mc once you are through with it. This code would go on a frame of your choice or I suppose it could be attached to another MC as an onClipEvent or a button action as well.

removeMovieClip (&quot;myMC&quot;);
Ya' Gotta Love It!
sleepyangelsBW.jpg
 
I could be wrong on this... seems this is for duplicated movie clips... I will check on it but perhaps someone who has used this can fill us in on the specifics... Ya' Gotta Love It!
sleepyangelsBW.jpg
 
Why is it not sufficient to make it invisible and/or to stop it?

Regards,
new.gif
 
I defined a
onClipEvent (enterFrame) for this movie.
This is movie is actually not in the part of the screen the user can see. I put this ugly movie outside of the scene because its single job is to do a looped action.
I do not want to loop the root timeline.
But when I order him to stop:

_root.ACTION.stop();

It still seems to loop because the vars are still changing.
 
If this is only a control clip, the easiest is to not use the onClipEvent(enterFrame) action, and simply put your code inside that movie clip. Then stopping the clip, will stop your variable's updating.
If you insist on keeping your onClipEvent maybe stop your variable's updating within the onClipEvent action itself.

In this example, I'm updating _root.count2 until it reaches 100. When it reaches 100, the onClipEvent still tries to update _root.count2, but I limit it, each time, to be equal to 100.

onClipEvent (enterFrame) {
if (_root.count2>=99) {
_root.count2 = 100;
} else {
_root.count2 += 1;
}
}

Regards,
And might I be blessed with your vote!
new.gif
 
I put this an end by going into the next frame in the main timeline. In the next frame the movie does exist, so it cannot make any trouble.
But I am not satisfied at all.
 
Germans are never satisfied! LOL

Just try either of my suggestions!

Regards,
new.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top