Run-time instances

Instances "on demand"

Symbol in Flash must be created "manually" in the design time. It needs to be at least given name by designer explicitly. Traditionally we drag and drop symbols instances to the stage to make them participate in the application or Web page. For now you have learnt how to change properties and call methods of the instance programmatically

However, even creation of the instance also may be done programmatically. It is enough to have a symbol in the library to construct the instance anytime and anywhere on the stage and then manipulate it as you whish.

Instance may be created, manipulated and destroyed from the code and obeying user's commands.

It is possible to create Arrays of instances which will be alike and still differ in some properties values.

Possibility to create instances gives enormous power to the programmer. We will spend only one lesson working on that area, but you will see the potential.

Next