A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Help Tweening Rotation 180 degrees on each button click

Threaded View

  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    5

    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.

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