3 Replies Latest reply on Feb 27, 2007 10:10 AM by kglad

    Keypress for scenes

    micahgf
      After doing searches here and elsewhere, and since I'm fairly new to this, I'm looking to controll a projecter using Global functions.
      I need to do this by only using keys on the keyboard. space would be for next scene, right arrow for next scene, left arrow previous scene, less than is previous frame, greater than is next frame, end is stop and Home goes to movie beginning. Am I able to controll this way without having to put code in each frame or scene to stop? Appreciate input, help, an example or place to refere to.

      Thanks
        • 1. Re: Keypress for scenes
          kglad Adobe Community Professional & MVP
          you can but your apt to run into problems. flash navigation using scenes is notoriously unreliable.

          you would be better served to label your frame and use the frame labels with the goto methods like _root.gotoAndPlay("scene1_frame 1");

          • 2. Re: Keypress for scenes
            micahgf Level 1
            quote:

            Originally posted by: kglad
            you can but your apt to run into problems. flash navigation using scenes is notoriously unreliable.

            you would be better served to label your frame and use the frame labels with the goto methods like _root.gotoAndPlay("scene1_frame 1");




            Does the example given imply that a keypress should be placed in the beginning of each new scene?
            Can I write code that states say:

            } else if (Key.getCode() == 39) {
            // RIGHT ARROW
            _root.gotoAndPlay("scene1_frame 1");

            So, there would be no way to advance to "scene2_frame1") in the same else if statement?
            nextScene (); doesn't work; That I know.
            • 3. Re: Keypress for scenes
              kglad Adobe Community Professional & MVP
              you can place all your coding in frame 1 of your first scene.

              as long as your frame labels are unique (and they must be or the flash compiler will generate an error message) there is no risk of the wrong scene/frame playing.

              there are some work-arounds so your right arrow WILL advance to frame 1 of the next scene. for example, in frame 1 of each scene assign a (scene) number to a scene variable: