Jump to content
Search Community

Recommended Posts

Posted

Hello guys

How do I make that the object that I click, start moving in circles ( 2-3 times ) around the stage before arriving at its end position.Something like in this picture.

PS: it doesnt have to have an exact radius or exact steps, it just has to rotate 1-2 times and after that go to the certain point on the stage.

 

Screen_Shot_2014_04_27_at_18_06_50.png

the way I figured out it could be is something like this:

private function onClick( ev:MouseEvent ):void
    {
        var currentObj:Sprite = ev.currentTarget as Sprite;

        TweenLite.to(currentObj, 1, {x:first_X, y:first_Y, onComplete:goToPosition2 });

        function goToPosition2():void
        {
            TweenLite.to(currentObj, 1, {x:secontd_X, y:second_Y, onComplete:goToPosition3 });
        }

        function goToPosition3():void
        {
            TweenLite.to(currentObj, 1, {x:third_X, y:third_Y, onComplete:goToPosition4 });
        }
        ..
        ..
        .
        .
        .
        //and so on and so on

    }

yet I somehow feel that this is very wrong way of doing it.

thanks.

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...