3 Replies Latest reply on Dec 17, 2007 9:51 AM by Varangian

    Rotation problem

    Varangian
      Hello,

      I want to rotate an object one angle at a time. So I have a loop that plays the mx:Rotate on a target object until it reaches it's targets (changing the angle by 1 and then use .play() . It works but not visually. Somehow I tried the repeatDelay = 1000 property, so that it looks like rotating one angle at a time.

      how can I do this? please help!
        • 1. Re: Rotation problem
          Varangian Level 1
          Hello,

          did I posted in the correct forum?

          the problem is that I want to rotate mx:Rotate 1 angle at time while moving mx:Move the object by 1 at a time. How can I do this if its possible to be done?

          Thanks!
          • 2. Re: Rotation problem
            peterent Level 2
            You won't be able to see anything if you have a loop changing the angle - you aren't giving the Flash Player time to make the visual change. All your ActionScript code does is set up the display list for the Flash Player. Once your function exists, the Flash Player then acts on the display list instructions.

            To show this rotation you have to just increment the angle, then exit the function. To go back to the function and increment again, set an effectEnd event handler on the effect. The handler will get called once the rotation completes and you can increment the angle and do it again.

            It takes a little getting used to, but the Flash Player is event-driven. You'll find that you'll be using this technique throughout your programming.
            • 3. Re: Rotation problem
              Varangian Level 1
              Hello peterent,

              thanks very much it worked,

              It never came to my mind to do something like this. I'm just too new to the flex and the flash player thing.

              Thanks again really appreciate!