A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Incremental rotation of an MC by a button

  1. #1
    Junior Member
    Join Date
    Mar 2001
    Posts
    1
    With Flash 4 using Actionscript I am trying to control the rotation of a static one frame movie clip in a scene by clicking on a button. I have the MC moving left, right, up and down in 10 pixel increments with four buttons, but I need to make it rotate with a rotation button that is repeatedly clicked to move the MC through 360 degrees in 10 degree increments. I have assumed that the variable of rotation is degrees, but I can't get it to work. Can someone please help me?

  2. #2
    hi,
    here is how to do it
    __________
    On (Release)
    Set Variable: "/:toAdd" = 10
    Set Property ("/yourMovieClip", Rotation) = GetProperty ( "/yourMovieClip", _rotation ) + /:toAdd
    End On
    _______________
    regards
    [Edited by MuhammadZamir on 03-28-2001 at 07:17 AM]

  3. #3
    Member
    Join Date
    Mar 2001
    Location
    Venice, CA
    Posts
    88

    it's the incredible shrinking movie clip!

    Hi,

    I did a movie recently where I set up the rotation that exact way. I was also simultaneously changing the x and y position based on where a user had dropped the object after a drag.

    I ran into a problem, though - whenever I put the rotation snippet in, the mc in question reduced in size as it rotated. I couldn't pinpoint why, exactly, but I did end up changing the code so that it didn't get the current rotation property. Instead, I just set up a rotation variable and set the rotation to that, like this:

    Set Variable: "/:myRotation" = /:myRotation + 10
    Set Property ("/yourMovieClip", Rotation) = /:myRotation

    It stopped the mc from "shrinking".

    There may very well have been elements in my movie that caused this reaction outside of the rotation code (and therefore won't happen in yours), but I just wanted to post this in case you run into the same problem.

    Best,
    Kate

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center