Tag Archive for 'AS2'

Free Flash Preloader Component - simple but featured loading activity indicator.

Free Flash Preloader component provides an easy way to add a nice visual loading indicatior when loading images or external swf files.

You may skin the preloader component and display any flash animation while loading your data.

It is extremely simple to use. Just place an instance of preloader component on the stage:

Adding preloader component

And set the parameters:

Preloader parameters

ActionScript2’s DON’T!

This is just a small note for all of those who is still developing using AS2.

The complete DON’T for AS2 classes is:

Never ever do create objects of your members arrays in declaration. Create them in the constructor instead.

ActionScript. Constructor parameters when extending MovieClip class, Flash AS2 vs. AS3

Constructor is a method which is called when an object of a class is instanced.
Like in any programming language, in actionscript constructor must have the same name the class has.

Constructor, as a function, may take any number of parameters.
Which is very handy to pass to initialize the objects.
I would recommend using constructor parameters over calling any additional initializing methods.

Here is a good example of using constructors in ActionScript:

var myPoint:Point = new Point(0,0);

And I can give you a lot of such examples.

However, this article is about a particular case, passing parameters to a constructor of your class, which is inherited from (extends) MovieClip.