Movie clip symbols in the Library
Movieclip symbols can be referenced by actionscripting, they can contain animation or a series of sprites (depending if you ask the timeline to play or to stop) and new instances of a movieclip can be created through code.
(for a movieclip called BlueCircle in the AS Linkage)*
var |
newCircle | : BlueCircle | = | new BlueCircle (); |
this. |
addChild | (newCircle); | ||
Notice that we are creating a variable containing our new instance of the movieclip so the code knows the new instance of BlueCircle as newCircle.
* to name a movieclip for an exteral AS
file, or to generate new instances throug code, you need to click on the small button on the right of the Library panel, go to "Properties" (symbol Properties) and click on the advanced button at the bottom, in the Class textfield enter the name of the movieclip.
Now we can define the properties of this object, like:
(In the window below you can see a list of all the properties that we can refer to)
newCircle |
. | x | = | 225 | Horizotal size in pixels |
newCircle |
. | y | = | 5 | Vertical size in pixels |
newCircle |
. | scaleX | = | 0.5 | Horizontal scale size in pixels |
newCircle |
. | scaleY | = | 3 | Horizontal scale size in pixels |