Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3311844
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:55:28+00:00 2026-05-17T21:55:28+00:00

In my Flash File I have a wheel. The user is able to rotate

  • 0

In my Flash File I have a wheel. The user is able to rotate the wheel by using arrows to jump to the next “segment” (think 20 images attached to each other forming the circumference of the wheel).
Wheel

Clicking the arrows initiates this code:

protected function rotate():void
        {
            var rotateTo:Number = (-360 / numItems) * currentItem + 90;
            TweenLite.to(planesHolder, 1, { rotationY:rotateTo, ease:Quint.easeInOut } );
        }

However, what I want to be able to do is, click and drag to spin the wheel, complete with acceleration and deceleration and even settling on the nearest image when the wheel reduces to a certain speed. I have no idea how to go about doing this: I’ll need to kinda detect a before and after position of the cursor and translate this into a speed for the wheel which then decelerates over time and also detect which image is closest at a certain speed and “snap” it, both scrolling up and down. (it’ll only affect the Y-axis)

Any help would be appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:55:29+00:00Added an answer on May 17, 2026 at 9:55 pm

    While the mouse is down, in an Enter_frame check for the current offset to the previous position:

    private function enterFrameHandler(e:Event)
    {
      offset = oldy - oldMousePosition;
      oldy = oldMousePosition
    }
    

    This should give you the current velocity. (obivously, for the wheel it’s “wheel.rotation += offset / some_value_to_slow_it_down” in an enterFrame again).

    to introduce “easing” you can use a friction variable.

    again, in the enterFrame event:

    offset *= .8;
    

    and then in order to snap to the next image, check how fast your current velocity is; if it’s below a certain tolerance set the velocity to 0 and ease it to the nearest value. (you guessed it, in an enterFrame event again

    if(offset < 1)
    {
      offset = 0;
      //calculate the nearest value of the wheel
      //tweenlite right over there
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have a flash file. Which contain images. I want to place an
I have an AS2 Flash SWF that is calling another AS2 Flash File using
I'm using Flash CS5 and I have a problem with my exported SWF file:
I have a flash file and am using google's suggested method for as2 event
I have the exe file of micromedia flash player. I am able to run
I have one flash file which is embading in another, the embeded one is
I have a flash file (.swf) on the homepage of my web site. When
I have a flash file menu i am having problem while link it to
I have a flash file that displays the server respone on screen. The respone
I have this swf (flash) file that provides the json that needs to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.