6 Replies Latest reply on Nov 17, 2006 5:26 PM by kglad

    a weird quirk

    PepperKev Level 1
      Hi everyone;

      I have this weird thing happening in my Flash movie and I'm hoping someone can explain it!

      This is the description:

      In one part of the Flash movie, the user advances through screens like a slideshow. The choices are Next and Back.
      On each screen, a new MC appears, animates for about 2 seconds, then settles in its final position and stays there throughout. Pretty simple. Each MC is on a different layer in the timeline so it isn't broken by keyframes and doesn't restart when the user advances.

      Pretty simple stuff, and when the user clicks the "next" button, it works as advertised.

      Now the complication. The client requested that the right arrow key and the spacebar also act as next buttons. So you can click the button or press the key. So fine, I set that up. What happens is, if you click the "Next" button the MCs stay in their lockup position. But if you use the arrow key or space bar, all the MCs refresh and go through their 2-second animation shpiel everytime you advance.

      As you can imagine, this looks kinda dumb. The code on the next button and the code for the key presses looks pretty much the same; I'm using goToAndPlay - I can't figure out why the MCs refresh on the key presses but not on the button clicks.

      I've tried just using nextFrame(); but this creates a whole new raft of problems; it will go two or three frames ahead, or bring in all the MCs at the same time - in truth, the chaos is too complete to really describe!
        • 1. Re: a weird quirk
          kglad Adobe Community Professional & MVP
          does this occur only in the flash test environment? if so, disable keyboard shortcuts to test.
          • 2. Re: a weird quirk
            PepperKev Level 1
            Hi Kglad
            No, I'm publishing it to Mac and Windows projectors. I'm testing with the actual Mac projector. The product is a disc-based sales presentation - glorified PowerPoint for sales reps. I rarely use the test movie option because I always seem to get surprises when I actually publish.

            Is this maybe not an actionscript problem? If so, my apologies for putting it in the wrong forum. Probaby an ID10T error :)


            • 3. Re: a weird quirk
              kglad Adobe Community Professional & MVP
              try using the goto methods:

              • 4. Re: a weird quirk
                PepperKev Level 1
                Sorry I didn't get back sooner, other work emergencies.

                The _root addition didn't do it, I'm afraid.

                Could it be something to do with the way Flash processes Key presses? Not that I have any idea what I'm talking about, I'm just wondering.

                • 5. Re: a weird quirk
                  RemyR
                  I'm not sure if this is it, and this might be a very newbie answer, but...

                  I was under the impression that, with the code as you've got it above, if the button code is "inside" the button instance, that it's actually going to and playing it's version of the Timeline at label "Solutions4".
                  Why that should make a difference, I don't know - except that perhaps it's only gotoAndPlay-ing it's timeline, which doesn't include the "Solution" movieClips on the main Timeline. Perhaps if you put the Key event handler code in it's own movieClip instead of the main Timeline, that might help.
                  Or, if the "Solution" movieClips have their own timelines properly set (sounds like they do, if they animate then stop), you could probably use gotoAndStop, since that just stops the main Timeline, not the MC instances.
                  • 6. Re: a weird quirk
                    kglad Adobe Community Professional & MVP
                    attached to your button in the test environment use: