|
-
Help Tweening Rotation 180 degrees on each button click
Hi ! I have what is hopefully a quick question. I have set up a motion tween using the flash tween class to rotate an image 180 degrees. However, if I should want to work wit hthe image from that point (say click the button again and have it rotate another 180 degrees back to its original position) I can't. It will simply run the tween again because my function specifies to go from 0 to 180. Does anyone have any idea how I can use the tween class to rotate this image 180 degrees on each button click? Thanks in advance for your input. Code is below.
import fl.transitions.*;
import fl.transitions.easing.*;
import fl.transitions.Tween;
rotation1_btn.addEventListener(MouseEvent.CLICK, rotateThePicture);
function rotateThePicture(event:MouseEvent) {
//IMG11_mc.rotation += 180;
var PicRotation:Tween= new Tween(IMG11_mc, "rotation", Strong.easeInOut, 0, 180, 5, true);
};
Last edited by Crash886; 03-30-2011 at 03:13 PM.
-
Actionscript Code:
var PicRotation:Tween= new Tween(IMG11_mc, "rotation", Strong.easeInOut, IMG11_mc.rotation+180, IMG11_mc.rotation, 5, true);
?
-
Thank you!!
That was EXACTLY what I was looking for! Thanks for helping out a n00b!! VERY appreciated!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|