Thursday, December 25, 2008

How to attachMovie in AS3

In this example I will show you how to add a movieClip to your flash AS3 as you would in AS2 which use the attachMovie function.


var testClip:MovieClip = new clips();

testClip.x = 200;
testClip.y = 200;

and then do this:

Get to properties of the movie clip by right clicking at the item at your library. Give the movieClip a name and click at the 'export for actionScript checkbox.

The class name will be generated automatically for you.

Your done. You may test your movie..

Take note that "var testClip:MovieClip = new clips();" the 'clips()' are actually the class name as in the properties box.

No comments: