2 Replies Latest reply on Feb 24, 2009 9:16 AM by FONGHO

    Real time movement in an onRollOver loop

      I'm relatively new to flash and i'm trying to create an interactive story for my kid's. The movie involves moving the cursor over a "bed" which is a button and the "cat" which is a movie instance would move to the bed. I've been trying to use a while loop but I either not get any response or end up with an infinite loop. The code i've been trying to use is as follows.

      Any assistance is deeply appreciated. Thank you.
        • 1. Re: Real time movement in an onRollOver loop
          Try a gotoAndPlay statement with your cat mc. That way when you rollover the bed you can play the frames of content in your cat clip which allow it to get onto the bed ending with a stop() command on its main timeline.

          bed.onRollOver = function(){



          If you need specific criteria for when the cat action occurs, you should probably use and if statement...

          Hope this helps. :)
          • 2. Re: Real time movement in an onRollOver loop
            Level 1
            Oh i understand. But I also have the intention of adding directional buttons on the screen to allow the user to move the cat around a room.

            for example up_btn.onRollOver = function() { cat_mc._y+=5 ;}
            down_btn.onRollOver = function () {


            Thus I want to allow freeplay in terms of navigation, and all this performed just by moving the mouse..

            You mentioned end, if, could you suggest an example of a condition?

            Thank you.