1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

ActionScript Debugging

This is a simple little segment of code that i find very useful to work my way through flash files. It basically lists all the properties (which includes direct children) of the target movieclip. Here’s a few implimentations…

(Set n beforehand with something like var n = my_mc)

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

and thats it in a nutshell. Your output will be something like this;

property : value

Ok, so thats not a very good example, but try it and you’ll see.
Here’s a function-based version for you…

traceProperties = function(movieclip){
n = movieclip;
for(i in n){
trace(i+" : "+n[i]);
}
}

and it’s Actionscript 2.0 sibling…

function traceProperties(n:Object):Void{
for(var i in n){
trace(i+" : "+n[i]);
}
}

No Comments »

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Note: This post is over 3 years old. You may want to check later in this blog to see if there is new information relevant to your comment.