Thanks very much for your time! Here is my question,…
public function addNewMc():void{
var newMC:MovieClip= new MovieClip();
this.addChild(newMC);
}
public function removeOldMc(newMC):void{
this.removeChild(newMC);
}
How can I create a new MovieClip within a method, which can be used throughout the class, without defining it at the top of the class? And for extra points, without using return.
I can get it to work, if the first function addNewMc returns the value newMC, and passing that to any other methods… but for what I am writing, I hope to use up my return with something else. Thanks!
Don’t know if I’m understanding you completely but it sounds like you want access to a dynamically created Movieclip without explicitly defining it?! is that right?
If so, then you could do what you have now but add a method for retrieval:
You could also add a name property to the dynamically created movieclip:
you could then retrieve like this:
Again don’t know if I’m understanding your exact requirements
cheers
erick 😉