Arrays; arrays are gooood…!

Building something big in Actionscript is hardly a problem, making it easy to work with, can be a bit tricky.
I’ve through experience (hard earned, I might ad) learned that the Array() is a good way to store elements, MovieClips, for instance.

After you create your MovieClips, and under “Linkage…” exports them for Actionscript, you can put them into an Array, simply by:
var Bunch:Array = new Array();
Bunch["hello"] = new Element_1();
Bunch["mom"] = new Element_2();
Bunch["hows"] = new Element_3();
Bunch["things"] = new Element_4();

This way it is easy to grab them again later, i.e. by listening for a click on a button with the data or name set to String ”mom”. Or just cycle through them with a Timer().

Keep in mind, though, this hasn’t been tested on a large scale with large MovieClips or, for that matter, entire Scenes. But works fine with small objects, such as logo, banners, images.
“Testing pending” :)

Advertisement

Tags: , ,

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.