Reputation: 1
My project is an interactive ebook and I created different scenes for each page ( there are 1 to 19 scenes) I need to insert some ActionScript in order to be able to return to the homepage, and go to some other pages but when I click in the button in the scene, this error keeps showing up :
ArgumentError: Error #2108: Scene Scene 1 was not found.
at flash.display::MovieClip/gotoAndPlay()
at OPP_TCC_fla::MainTimeline/fl_ClickToGoToScene_50()
The code that I have written is :
b_home.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_50);
function fl_ClickToGoToScene_50(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Scene 1");
}
I don't know how to fix that! Any help is appreciated, thanks!
Upvotes: 0
Views: 759
Reputation: 11
Nope, that doesn't always work either...
ArgumentError: Error #2108: Scene ElDiabloChase was not found.
at flash.display::MovieClip/gotoAndPlay()
at Final_Project_v13b_QuitCode__700X438__EndCredits_fla::MainTimeline/ClickToGoToScene1()[Final_Project
I've literally stooped to the ridiculous task of copying the name from the scene list and pasting it into the code.
If you test the movie in a browser, it'll work most of the time, but in Animate, I can almost never get it to work right.
All I can think is that it's a weird "# of character thing" or something like that. I'm stumped.
Upvotes: 1
Reputation: 545
Like @Organis said in the comment, you have to specify the scene in the second argument.
MovieClip(this.root).gotoAndPlay(1, "Cena 19");
is going to take you to the first frame of Cena 19
.
MovieClip(this.root).gotoAndPlay(1, "Scene 1");
is going to take you to the first frame of Scene 1
.
See the answer to this question: Action Script - how to go to another scene from movieClip?
Upvotes: 0