# Update an instance position from an external class?

**URL:** <https://forum.kirupa.com/t/update-an-instance-position-from-an-external-class/255320>\
**Category:** flash\
**Created:** [March 21, 2008, 3:17am UTC](https://forum.kirupa.com/t/update-an-instance-position-from-an-external-class/255320 "2008-03-21T03:17:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kidkreep](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kidkreep](https://forum.kirupa.com/u/kidkreep)\
**Post date:** [March 21, 2008, 3:17am UTC](https://forum.kirupa.com/t/update-an-instance-position-from-an-external-class/255320/1 "2008-03-21T03:17:15Z")

</div>

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?
