Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Initial Tween, then wait for input

Recommended Posts

This is more of my rotating wheel thing.


I have a wheel that rotates when a user clicks on a button contained on the wheel; the amount of rotation depends on which button is clicked. When the button is clicked, the wheel rotates and a small animation plays, also depending on which button was clicked. I want the Wheel mc to play the animation associated with its first position - when the Wheel mc loads for the first time ONLY. I can't seem to get this to happen, most likely due to being stuck in AS2 syntax. Here's the code:


import com.greensock.*;

import com.greensock.easing.*;


//this is what's not working, and it also prevents the rest of the script from working properly //


function spinInit(event:Event):void {

TweenMax.to(Wheel, .5, {rotation:30, ease:Cubic.easeIn});



//end of what doesn't work //



function spin(event:MouseEvent):void {

TweenMax.to(Wheel, .5, {rotation:30, ease:Cubic.easeIn});





function spin2(event:MouseEvent):void {

TweenMax.to(Wheel, .5, {rotation:20, ease:Cubic.easeIn});




etc etc etc


TIA for your suggestions

Link to comment
Share on other sites

I don't think ENTER_FRAME is what you want because that will happen repeatedly... if you want something to happen just once create a function to do that thing and call the function once.



function spinInit():void {
TweenMax.to(Wheel, .5, {rotation:30, ease:Cubic.easeIn});

//when Wheel loads just do:


Link to comment
Share on other sites

That's it, thanks.


I've really got to try and get my head around AS3. I don't do as much Flash stuff as I used to, but I don't want to be forever stuck in AS2 syntax...

Link to comment
Share on other sites

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.