Which one is faster? Why?
var messages:Array = [.....]
// 1 - for
var len:int = messages.length;
for (var i:int = 0; i < len; i++) {
var o:Object = messages[i];
// ...
}
// 2 - foreach
for each (var o:Object in messages) {
// ...
}
How do you get an instance of the actionscript class Class from an instance of that class?
In Python, this would be x.__class__; in Java, x.getClass();.
I'm aware that certain terrible hacks exist to do this, but I'm …
In Flex, say I have a Class object. How do I get a string for the class it represents?
e.g.:
var clazz:Class= String;
trace(clazz); // this gives "[class String]" but what I want is "String"