Objects in AS3. Experiment. January 4, 2011
Posted by samoiloff in Actionscript, Code, Labs, Samples.Tags: Actionsc, Code, Experiment, Sample
trackback
Today I’m playing around with Flash Object.
Sample code:
var obj:Object = {}
obj[4] = "test";
obj["6"] = "test1";
trace("obj[4] : " + obj[4]);
trace("\n String");
for (var prop:String in obj) {
trace(prop +":" + obj[prop]);
}
trace("\n *");
for (var prop1:* in obj) {
trace(prop1+":" + obj[prop1]);
}
obj["4"] = "test2";
trace("\n int to string : " + obj[4]);
and traces:
obj[4] : test
String
4:test
6:test1
*
4:test
6:test1
int to string : test2
Advertisement
Comments»
No comments yet — be the first.