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:
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
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?