Jump to content
Search Community

Rotation/Blur help

retropunk test
Moderator Tag

Recommended Posts

Hello everyone, I'm new here and somewhat new to AS3 so I apologize for any newbie questions.

First off I want to applaud Greensock for this effort. I couldn't sign up fast enough! Some of the best code I've come across and for $99! Amazing work!

 

I'm making a small Wheel of Fortune type game and I am using the rotate and blur tweens and they work great.

The problem I am having is that when I rotate the wheel several times and then slow it down over time I can't get it to stop smoothly when it gets near the predetermined position.

It stops on the right marks but it will jump abruptly at times. I tried using short rotation but I think I might be implementing it wrong.

 

I'm attaching the fla. I have code on the timeline so please don't bash me. :)

 

When you click the button to spin the wheel watch how it spins and blurs. Totally great but I'd like to have it stop a bit more gracefully.

 

Thanks in advance for the help!

- Patrick

Link to comment
Share on other sites

Yeah, you had some really funky stuff going on with your Timer and ENTER_FRAME listeners - the logic made the wheel suddenly jump at the end, but I think it could be significantly simplified. I've attached a new FLA that uses about 1/3rd or less of the code for that function and will perform much better since it got rid of the extra ENTER_FRAME and Timer logic. Feel free to mess with the easing, etc. to get the effect you're after. I only touched the spinTheWheel() method. By the way, I'd strongly recommend avoiding nested functions because they get deleted as soon as the parent function finishes running. They cause all sorts of confusion for folks. You had 2 nested functions for handling the Timer and ENTER_FRAME logic. Hope that helps.

 

WangoWheel2.zip

Link to comment
Share on other sites

wow! that was simply awesome. I have tears in my eyes right now! Thanks a million!

I appreciate the tips on my coding. I still have much to learn.

 

I've been coasting too long on AS2 and its been to daunting taking on AS3 on my own. I can honestly say that after finding your classes I have a new found love for Flash again. It reminds me of when I first found Flash back in the 3.0 days! They just introduced alpha and I was never so excited.

Thanks for making it fun again.

 

- Patrick

Link to comment
Share on other sites

  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...