Actionscript 3 Answers: targeting

Out of context: Reply #3

  • Started
  • Last post
  • 3 Responses
  • NONEIS0

    OK, so here's the thing. You need to wait for your classes to initialize before trying to use MovieClips that are on your stage.

    In your constructor for the document class, add an event listener for ADDED_TO_STAGE, make that call a function that does your set up code. No need for an array unless you really want one, you can simply use the instance names if you wait for that event to fire, or store them into private vars which is far better.

    • I had no luck using private vars to target any movie clips from other classes. And wouldn't they have to be public?CyBrain
    • not if you use getter setter methods, the var does not need to be public, as much as a method of telling the class to do something.NONEIS
    • something.NONEIS

View thread