Posted By

creativelifeform on 04/07/09


Tagged


Versions (?)

Accessing Library elements


 / Published in: ActionScript 3
 

Simple but useful

  1. //Create a movieclip and tick export for actionscript in the creation dialog. Give it a class. That class is how you identify it in your code:
  2.  
  3. //Here, the movieclip's class is Button
  4. var _button:Button = new Button();
  5. function CreateButton() {
  6. this.addChild(_button);
  7. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: creativelifeform on September 9, 2010

Note that the var name and the class name cannot be the same otherwise AS3 will throw a type error.

You need to login to post a comment.