A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: HELP: Smooth Rotating vinyl

  1. #1
    Junior Member
    Join Date
    Sep 2009
    Location
    London, England
    Posts
    7

    HELP: Smooth Rotating vinyl

    Hey everyone,

    I am trying to create a rotating vinyl. I have managed to do this but after every full rotation the vinyl sticks.

    How can I make the rotation smooth without it sticking.

    it's a 20 frame movie clip.

    Any help/suggestions would be greatly appreciated.

    DSyd

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Russia: Western Siberia
    Posts
    268
    It would be easier to help you if you explained the way you've created your movie clip or upload your fla file here

    But actually, if you wanna create a rotating object, the easiest way to do this is to add an event listener for ENTER_FRAME event to your object and add some degrees to this object's rotation property every frame
    actionscript Code:
    vinyl.addEventListener(Event.ENTER_FRAME, rotateVynil);

    function rotateVinyl(e:Event):void
    {
         vinyl.rotation += 5;
    }
    Last edited by caseyryan; 07-31-2010 at 05:30 AM.

  3. #3
    Junior Member
    Join Date
    Sep 2009
    Location
    London, England
    Posts
    7
    Hi Casey,

    Thanks for your comment.

    Can you tell me if I should create just one layer and use the above script for each frame?

    How do I upload a .fla file to here? Sorry.....I am such a noobie!

    Dsyd

  4. #4
    Senior Member
    Join Date
    May 2010
    Location
    Russia: Western Siberia
    Posts
    268
    How do I upload a .fla file to here? Sorry.....I am such a noobie!
    Under quick reply box click Go advanced, then -> manage attachments

    Can you tell me if I should create just one layer and use the above script for each frame?
    It will work the same but definitely be easier to manage.

  5. #5
    Junior Member
    Join Date
    Sep 2009
    Location
    London, England
    Posts
    7
    I found an actionscript command which seems to be working now.

    Do you think I could make the rotation smoother?
    Attached Files Attached Files

  6. #6
    Senior Member
    Join Date
    May 2010
    Location
    Russia: Western Siberia
    Posts
    268
    Yes. In your library, right-click the lyricforge_rec2.png image and go to properties. Under compression choose Lossless, and check Allow Smoothing. This will do the trick.

    But I see the problem with rotation. When it reaches the last frame it stops for a while and then starts to rotate again.

    So, look at how I did it http://slil.ru/29531668
    Last edited by caseyryan; 08-04-2010 at 07:35 AM.

  7. #7
    Junior Member
    Join Date
    Sep 2009
    Location
    London, England
    Posts
    7
    Dude,

    That's awesome!

    You're a legend! Thank you, thank you!

    I feel like i've learned something today

    Cheers,
    DSyd

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