# Accessing stage objects with in a class

**URL:** https://forum.kirupa.com/t/accessing-stage-objects-with-in-a-class/294857
**Category:** flash
**Created:** [August 20, 2009, 10:48pm UTC](https://forum.kirupa.com/t/accessing-stage-objects-with-in-a-class/294857 "2009-08-20T22:48:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jesseclark](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@jesseclark](https://forum.kirupa.com/u/jesseclark)
#### Post date: [August 20, 2009, 10:48pm UTC](https://forum.kirupa.com/t/accessing-stage-objects-with-in-a-class/294857/1 "2009-08-20T22:48:08Z")

</div>

Sorry if this quesiton has been posted, but I don’t think I am using the right terms to search. I am trying to learn how classes can interact with each other and I came across a problem I can’t solve.

On my stage I have a MovieClip called “myMovieClip”.

Toplevel.as:

```auto

package edu.mydomain{
    import flash.display.Sprite;
    public class TopLevel extends Sprite {           
        public function TopLevel() {
              var temp:SecondClass = new SecondClass;
        }
    }
}

```

SecondClass.as:

```auto

package edu.mydomain{
 import flash.display.*;
 class SecondClass extends MovieClip{
  public function SecondClass(){
   root.myMovieClip.x = 0;
  }
 }
}

```

How do I access the [COLOR=black][FONT=Verdana]properties [/FONT][/COLOR]of myMovieClip. root.\* gives me an error.

Another question; If one class creates the object dynamically in actionscript, can I have a different class edit the [COLOR=black][FONT=Verdana]properties [/FONT][/COLOR]of that class?

Thanks in advance.
