SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2007
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    rotate 360 and stop

    Does anybody know how I can get a movie clip to rotate 360 degrees and then stop. I'd even like it to start it's rotation slow and then speed up at the end. I need to do it with action script. I'd like to use Action script 2, since I'm not up to speed on 3 yet.
    Thanks.
    R

  2. #2
    SitePoint Addict rosem's Avatar
    Join Date
    Jul 2003
    Location
    Chicago, IL
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    
    var tRotate:Tween = new Tween(mcSquare, "_rotation", Strong.easeIn, 0, 360, 5, true);
    This url will help a lot:
    http://www.kirupa.com/developer/actionscript/tween.htm

  3. #3
    SitePoint Addict rosem's Avatar
    Join Date
    Jul 2003
    Location
    Chicago, IL
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've attached a .zip file with an example FLA as well.
    Attached Files Attached Files

  4. #4
    SitePoint Zealot
    Join Date
    Feb 2007
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you, rosem. I'm assuming that's not AS3.
    So simple. But I don't recognize the syntax.
    Guess I'll hit the books.

    R

  5. #5
    SitePoint Addict rosem's Avatar
    Join Date
    Jul 2003
    Location
    Chicago, IL
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, it's AS2.

    The Tween class is a class that ships with Flash, but you have to import it to use it. Basically the first two lines are importing the Tween and Easing classes.

    The last line greats a new Tween. This might help:

    var tRotate:Tween = new Tween(MovieClip to Tween, "property", Easing Type, Start Value, End Value, Time in Seconds, True = Sets it to Seconds, not Frames);

    Read through that URL I included, it should answer everything.


Bookmarks

Posting Permissions

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