Jump to content
Sign in to follow this  
zille

Moving From One Scene To Another Using Button Problem AS3

Recommended Posts

I have made a small quiz application in flash. Beginner.
I have added this code for "Select Country" button :
scountry.addEventListener(MouseEvent.CLICK, goscountry);function goscountry(event:MouseEvent):void{	gotoAndPlay(1, "Map");}

I get error So I tried this:

ArgumentError: Error #2108: Scene Map was not found.
at flash.display::MovieClip/gotoAndPlay()
at Assignment1_Menu_fla::MainTimeline/fl_ClickToGoToScene_9()
scountry.addEventListener(MouseEvent.CLICK, goscountry);function goscountry(event:MouseEvent):void{	gotoAndPlay(1, "Map");} 

I get error again:

ArgumentError: Error #2108: Scene Map was not found.at flash.display::MovieClip/gotoAndPlay()at Assignment1_Menu_fla::Nav1_4/goscountry()

 

Can anyone help me linking the Map Scene with button "Select Country" button in Main Scene.

The project file is attached: Natok (27MB)

Edited by zille

Share this post


Link to post
Share on other sites

Those 2 pieces of code are the same. I haven't downloaded the 27MB project file, but you might not be targeting the correct movie clip with gotoAndPlay. Normally you would specify a movie clip with that, like _parent.gotoAndPlay or _root.gotoAndPlay, or the instance name of an existing movie clip.

Share this post


Link to post
Share on other sites

Is the scene called "Map" or is it something else, like "map" or "MAP"?

Share this post


Link to post
Share on other sites

Actually my code was correct. I was click on "Test Scene" and button not working but when I clicked on "Test Movie" it was working fine.

Thank you

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×