First post!
Been searching the boards/web for a couple days now looking for an answer to the following. Apologies if this has already been answered previously. And I’m new to ActionScripting in general, hence the lengthy explanation:
I have an fla with a DocumentClass. I also have two classes called Ball and Buttons.
- The DocumentClass creates an instance of Button and adds it to the stage.
- When clicked, the button adds an instance of Ball to the stage. (let’s call it _ball)
- Immediately after creating _ball, a function Go() is called from the button class (e.g., _ball.Go(); )
THE PROBLEM
- I also want to Go(); function to update the position of the instance _ball, but the instance isn’t recognized within the class Ball.
(if I try _ball.x = 100 I get, 1119: Access of possibly undefined property ball through a reference with static type flash.display:Stage.)
How would one go about doing this?