# Help on changing Scenes from a (non-document) class

**URL:** <https://forum.kirupa.com/t/help-on-changing-scenes-from-a-non-document-class/327440>\
**Category:** flash\
**Created:** [March 1, 2012, 2:58am UTC](https://forum.kirupa.com/t/help-on-changing-scenes-from-a-non-document-class/327440 "2012-03-01T02:58:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alpha\_Remex](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Alpha\_Remex](https://forum.kirupa.com/u/Alpha_Remex)\
**Post date:** [March 1, 2012, 2:58am UTC](https://forum.kirupa.com/t/help-on-changing-scenes-from-a-non-document-class/327440/1 "2012-03-01T02:58:14Z")

</div>

Hey Folks - I have a non-document class that I want to put in charge of changing scenes when some conditions are met.

First things first, I need to figure out how to change scenes!

Here’s my code:

```auto
package classes {
    
    import flash.display.MovieClip;
    import flash.display.Stage;
    
    public class SceneMaster extends MovieClip {
        
        public function SceneMaster(stg:Stage):void {
            
            trace("done", stg)
            gotoAndPlay(1, "Lobby");
        }
    }
}

```

Here’s the error I’m getting:

ArgumentError: Error #2108: Scene Lobby was not found.  
at flash.display::MovieClip/gotoAndPlay()  
at classes::SceneMaster()  
at GameMaster()

I’ve tried accessing it like this

```auto
stg.gotoAndPlay(1, "Lobby");

```

but I get this error:

1061: Call to a possibly undefined method gotoAndPlay through a reference with static type flash.display:Stage.

Anyone have any ideas on how to do this?
