Skip to main content
Known Participant
July 2, 2009
Question

how to handle movielclip of stage by class

  • July 2, 2009
  • 1 reply
  • 283 views

i m making three movie Clip A, B, C in Main movieclip on stage .

can u tell me how to handle these movieclip by cleass file in actionscript 3.0.

i dont want to access these movieclip from libaray.

This topic has been closed for replies.

1 reply

July 2, 2009

For each clip in the library that you want to control from your class you set the linkage properties and give the item a class name. The class name you give it allows you to instantiate it from code.

So, say you have a document class, and want to put clip A on stage in the constructor, and you've given it a class name of LibraryClipA:

package{

     class MyDoc{

          private var clipA:LibraryClipA;

          function MyDoc(){

               clipA = new LibraryClipA();

               clipA.x = 100;

               clipA.y = 100;

               addChild(clipA);

          }

     }

}