# Communicating with stage or root from an AS3 class

**URL:** <https://forum.kirupa.com/t/communicating-with-stage-or-root-from-an-as3-class/246277>\
**Category:** Uncategorized\
**Created:** [December 9, 2007, 1:28pm UTC](https://forum.kirupa.com/t/communicating-with-stage-or-root-from-an-as3-class/246277 "2007-12-09T13:28:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![the\_lar](https://avatars.discourse-cdn.com/v4/letter/t/90ced4/32.png) [@the\_lar](https://forum.kirupa.com/u/the_lar)\
**Post date:** [December 9, 2007, 1:28pm UTC](https://forum.kirupa.com/t/communicating-with-stage-or-root-from-an-as3-class/246277/1 "2007-12-09T13:28:16Z")

</div>

Hi all,

I’m using the following code from an AS3 class which extends a Library symbol to tell the main timeline to do something:

```auto
MovieClip(this.root).gotoAndStop("game1");

```

I know I ‘should’ use stage, but it’s not working for me. EG:

```auto
package {
    import flash.display.MovieClip;
    import flash.display.Stage;
    import flash.display.SimpleButton;
    import flash.events.MouseEvent;
    
    public class StageTest extends MovieClip {
        private var theStage:Stage;
        public function StageTest(stageRef:Stage){
            theStage = stageRef;
            init();
        }
        private function init():void{
            SimpleBttn.addEventListener(MouseEvent.MOUSE_UP, simpleBttnHandler);
        }
        private function simpleBttnHandler(event:MouseEvent):void{
            doSomething();
        }
        private function doSomething():void{
            theStage.gotoAndPlay("something interesting");
        }
    }
}

```

What am I doing wrong here?  
Kind regards  
Kevin
