jump to navigation

Objects in AS3. Experiment. January 4, 2011

Posted by samoiloff in Actionscript, Code, Labs, Samples.
Tags: , , ,
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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.