Skip to main content
Participant
September 12, 2014
Answered

Duplicate function to another scene

  • September 12, 2014
  • 1 reply
  • 722 views

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

                 }

       }

}

This topic has been closed for replies.
Correct answer Ned Murphy

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.

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
September 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.