Skip to main content
Sparkerman1711
Inspiring
September 26, 2006
Answered

unloadClip() problem

  • September 26, 2006
  • 1 reply
  • 427 views
I can't seem to figure out how to use the unloadClip() method. I'm using the following code on the first frame of a movie. Basically it should work like this. loadButton loads the truck.swf file (which is does), then unloadButton should unload the clip (which it doesn't). clipHolderThing is the name of an empty movie clip instance that is already on the stage

loadButton.onRelease = function() {
var myLoader:MovieClipLoader = new MovieClipLoader();
myLoader.loadClip("truck.swf", clipHolderThing);

};
unloadButton.onRelease = function() {
myLoader.unloadClip(clipHolderThing);
};

What am I missing here?
This topic has been closed for replies.
Correct answer Sparkerman1711
Thanks!

That makes complete sense.

1 reply

Inspiring
September 26, 2006
You are using myLoader local to the function -> gets deleted right after the function has executed. In the onRelease event for the unloadButton myLoader therefore is undefined.
Solution: myLoader must be a timeline var. See attached code.

Sparkerman1711
Sparkerman1711AuthorCorrect answer
Inspiring
September 26, 2006
Thanks!

That makes complete sense.
Inspiring
September 27, 2006
You're welcome.