Skip to main content
Inspiring
April 4, 2012
Answered

How do you delete all dynamic variables of a movieclip?

  • April 4, 2012
  • 1 reply
  • 472 views

I have the movieclip:
mcGrazer

with quite a few dynamic variables like this:

mcGrazer.var1

mcGrazer.var2

etc.

If I use:

delete mcGrazer;

it doesn't delete the variables.

But if I use:

delete mcGrazer.var1

it deletes that individual variable.

is there a way to destroy all information (variables) of a particular movieclip?

Thanks.

This topic has been closed for replies.
Correct answer kglad

you can use:

function deleteVariablesF(mc:MovieClip):Void{

for(var s:String in mc){

delete a;

}

}

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
April 5, 2012

you can use:

function deleteVariablesF(mc:MovieClip):Void{

for(var s:String in mc){

delete a;

}

}