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

can't figure out how debug actionscript to move from frame to frame using labels

Community Beginner ,
Feb 01, 2018 Feb 01, 2018

The timeline I've composed is considerably more complicated than this, but basically the following setup is a proxy for the problem I'm having......

Given 5 labeled keyframes spaced out at one every 20 frames across 100 frames of one layer.

So.........

label1...........label2.............label3...........label4............label5

There are 5 button symbols in various places on the timeline, and each is consecutively addressed to a label

So......

button1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_76);

function fl_ClickToGoToAndStopAtFrame_76(event:MouseEvent):void

{

gotoAndStop("label1");

}

and so on........

So why can't I hop around randomly from label to label using these buttons?

If I click them in order....button1 then button2 then button3, etc., the hops are all executed, but if I don't click them consecutively, one button or another is temporarily deactivated somehow.....for example, clicking button1, then button4 then button2, then button5 then button3......a disordered sequence like this won't work- one or more of the buttons deactivates. I can pick the deactivated ones up again by finding one that is still active and moving to its label, then the others are reactivated....I don't understand why, and I can't find any solutions to this problem....has anyone encountered this kind of problem and found a solution?.

Thanks in advance

TOPICS
ActionScript
342
Translate
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

correct answers 1 Correct answer

Community Expert , Feb 01, 2018 Feb 01, 2018

put all that goto code for all 5 buttons in frame 1 and place all 5 buttons on stage at frame 1.

then use removeChild() and addChild() (or the visible property) to have your buttons appear in the frames you want.

Translate
Community Expert ,
Feb 01, 2018 Feb 01, 2018
LATEST

put all that goto code for all 5 buttons in frame 1 and place all 5 buttons on stage at frame 1.

then use removeChild() and addChild() (or the visible property) to have your buttons appear in the frames you want.

Translate
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