• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Navigation Menu

New Here ,
Aug 05, 2021 Aug 05, 2021

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. 

TOPICS
ActionScript , Code , How to , Other

Views

101

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 05, 2021 Aug 05, 2021

Copy link to clipboard

Copied

how many frames are in each scene?

is there any code in those scenes?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 05, 2021 Aug 05, 2021

Copy link to clipboard

Copied

24 frames and yes there is code in scene 1 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 05, 2021 Aug 05, 2021

Copy link to clipboard

Copied

insert* a screenshot showing you're looking at Scene 2 and showing its timeline similar to

 

kglad_0-1628187429832.png

 

*

kglad_1-1628187442428.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 06, 2021 Aug 06, 2021

Copy link to clipboard

Copied

LATEST

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");

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines