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

Duplicate function to another scene

New Here ,
Sep 12, 2014 Sep 12, 2014

Hi everyone,

I've got a problem with function. I have 3 scenes with simple navigation frames, next button/previous button. In Scene 1 I can navigate to next/previous frame by keyboard buttons, right/left. I must copy this function to Scene 2 and Scene 3. How Can I do it? When I copy this function to Scene 2 I have error with duplicate function. Change name function not resolve my problem.

function fl_changeSlideKeyboard(evt:KeyboardEvent):void

{

  if(evt.keyCode == 37)

       {

            if (currentFrame>0)

                 {

                      prevFrame();

                 }

       }

  else if (evt.keyCode == 39 || evt.keyCode == 32)

       {

            if (currentFrame<5)

                 {

                      nextFrame();

                 }

       }

}

TOPICS
ActionScript
689
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

LEGEND , Sep 12, 2014 Sep 12, 2014

I recommend getting away from using scenes at all.  They are an error waiting to happen when you build them in for navigation purposes.  Just keep everything in the first scene and if need be divide up the timeline into labeled sections or keep what you would have as separate scenes as separate movieclips instead.

PS -

if (currentFrame>0)

frame numbers start at 1, so that condition will always be true.

Translate
LEGEND ,
Sep 12, 2014 Sep 12, 2014
LATEST

I recommend getting away from using scenes at all.  They are an error waiting to happen when you build them in for navigation purposes.  Just keep everything in the first scene and if need be divide up the timeline into labeled sections or keep what you would have as separate scenes as separate movieclips instead.

PS -

if (currentFrame>0)

frame numbers start at 1, so that condition will always be true.

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