Copy link to clipboard
Copied
I am trying to create a navigation menu that uses buttons to change the scenes. However, when I addded in the code the scenes dont change and only appear for a few second.
code:
abortion_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_10);
function fl_ClickToGoToScene_10(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Scene 2");
}
contro_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_11);
function fl_ClickToGoToScene_11(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Scene 3");
}
pp_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_12);
function fl_ClickToGoToScene_12(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Scene 4");
}
Now the first button works but the second doesnt and the third wont even show scene four. Im not sure why the first button works yet the others are being so weird.
Ive looked all over for resources to help with this but nothing is working. Weird how adobe has no resources for interactive features in adobe animate. All that Ive found are very dated.
Copy link to clipboard
Copied
how many frames are in each scene?
is there any code in those scenes?
Copy link to clipboard
Copied
24 frames and yes there is code in scene 1
Copy link to clipboard
Copied
insert* a screenshot showing you're looking at Scene 2 and showing its timeline similar to
*
Copy link to clipboard
Copied
I've developed code to do what I think your trying to do. The first example I'm including is for my central menu which opens an swf for each of my lessons. The second is for the lesson menus, which jumps to different frames within the lesson file. Obviously you'll need to creat buttons and give the names that match the code. If you have any questions please ask. If this is not what you need please disregard. Kglad may be more helpful; he knows a lot more than I ever will.
CENTRAL MENU
BTN_Mendelian.addEventListener(MouseEvent.CLICK, Mendelian);
function Mendelian(event:MouseEvent):void
{ trace("Mendelian");
event.stopPropagation();
var LOAD:Loader = new Loader(); addChild(LOAD);
var url:URLRequest = new URLRequest("Mendelian.swf");
LOAD.load(url);
}
BTN_NonMendel.addEventListener(MouseEvent.CLICK, NonMendel);
function NonMendel(event:MouseEvent):void
{ trace("NonMendel");
event.stopPropagation();
var LOAD:Loader = new Loader(); addChild(LOAD);
var url:URLRequest = new URLRequest("Non-Mendelian.swf");
LOAD.load(url);
}
LESSON MENU
BTN_DihybridMB.addEventListener(MouseEvent.CLICK, DihybridMB);
function DihybridMB(event:MouseEvent):void
{ trace("DihybridMB");
event.stopPropagation();
gotoAndPlay(1, "Dihybrid Cross");
}