0

I'm trying to list the all variables in AS3 with the value. I want to do this because my code is getting some random number somewhere. Really, all I want to see is when the code gets the random number and I think listing it with the value at random points will help me find out what's messing it up.

I know you can do this in AS2 using:

for(var i in MovieClip){
    trace(i+":"+this[i]);
}

How can you do the same thing with AS3?

  • https://manikmagar.wordpress.com/2009/09/20/iterate-through-actionscript-object-properties-as-reflection/ – BadFeelingAboutThis May 09 '15 at 17:08
  • 1
    I don't think that's a great approach to debugging the problem. Have a think about where the random number might be being set or generated. If you can isolate the problem you can set a breakpoint or use a trace statement to figure out why you're getting the random number. I honestly can't think what you would learn from what you're attempting to do. – net.uk.sweet May 09 '15 at 23:24
  • possible duplicate of [Get the "key" of an object in Actionscript-3](http://stackoverflow.com/questions/2427284/get-the-key-of-an-object-in-actionscript-3) – Vesper May 12 '15 at 06:56

0 Answers0