Jump to content
GreenSock

incubus

why bezier drag movement labile timeline animation

Recommended Posts

Hi, i have a foot illustration and basically i want to click and drag foot object it's drags according to my movieclip point's x and y values. But when foot movieclip instructor animation played then i click the foot object it's position broken. I know i didn't explain clearly. Sorry my english. Here is below my source files. When you can see swf i hope you will understand, what i am trying to say.

 

source file : https://dl.dropboxusercontent.com/u/54591390/shoot_cursor.fla

Link to comment
Share on other sites

i've used - tween.invalidate(); it's works properly. but my trouble goes on when i click foot movieclip.

Link to comment
Share on other sites

Sorry, we're not typically awake at 5 o'clock in the morning;)

 

The problem is that you are using a TweenMax tween to control the position of handle_mc AND timeline tweens in flash. You can't do both. To test just add to frame1's code:

 

handleMC.x = 10;

 

When you compile you will see none of your timeline animation at all :(

 

---

 

I would suggest removing ALL the frames past frame1 and the guide layer from shoot_mc. 

 

SInce you already have the Bezier tween built you can do the same exact animation you were doing inside the shoot_mc movie clip. 

 

You can literally tween the progress of the Bezier tween you already created kind of like this:

 

function footAnimationFinished():void
{
tween = TweenMax.to(handleMC,.2, { bezier:{values:[
               {x:shoot_mc.d1.x,y:shoot_mc.d1.y},
               {x:shoot_mc.d2.x,y:shoot_mc.d2.y},
               {x:shoot_mc.d3.x,y:shoot_mc.d3.y},
               {x:shoot_mc.d4.x,y:shoot_mc.d4.y},
               {x:shoot_mc.d5.x,y:shoot_mc.d5.y},
               {x:shoot_mc.d6.x,y:shoot_mc.d6.y},
               {x:shoot_mc.d7.x,y:shoot_mc.d7.y}
           ],
               type:"thru",
               curviness:0
           },
               ease:Linear.easeNone,
               paused:true
           });




handleMC.buttonMode = true;
handleMC.addEventListener(MouseEvent.MOUSE_DOWN, onDownPoints);
handleMC.addEventListener(MouseEvent.MOUSE_UP, onUpPoints);
handleMC.addEventListener(MouseEvent.CLICK,onClick);
}

//This will tween the progress of your tween :)
var autoTween:TweenMax = TweenMax.to(tween, 1, {progress:0.5, repeat:10, yoyo:true});


function onDownPoints(event:MouseEvent):void
{
autoTween.pause();
startMouseY = mouseY - (handleMC.y + (handleMC.height/2))+225;
startMouseX = mouseX - (handleMC.x + (handleMC.width/2))+225;
stage.addEventListener(MouseEvent.MOUSE_MOVE, update);
stage.addEventListener(MouseEvent.MOUSE_UP, onUpPoints);
}

I attached a CS5 fla:

 

You will see that the dragging kind of works, but I think your formula needs a little tweaking. 

Unfortunately I don't know exactly what to recommend there.

Hopefully some of this helps you.

 

 

shoot_cursor_CS5.fla.zip

  • Like 2
Link to comment
Share on other sites

Sorry, we're not typically awake at 5 o'clock in the morning;)

 

The problem is that you are using a TweenMax tween to control the position of handle_mc AND timeline tweens in flash. You can't do both. To test just add to frame1's code:

 

handleMC.x = 10;

 

When you compile you will see none of your timeline animation at all :(

 

---

 

I would suggest removing ALL the frames past frame1 and the guide layer from shoot_mc. 

 

SInce you already have the Bezier tween built you can do the same exact animation you were doing inside the shoot_mc movie clip. 

 

You can literally tween the progress of the Bezier tween you already created kind of like this:

 

function footAnimationFinished():void
{
tween = TweenMax.to(handleMC,.2, { bezier:{values:[
               {x:shoot_mc.d1.x,y:shoot_mc.d1.y},
               {x:shoot_mc.d2.x,y:shoot_mc.d2.y},
               {x:shoot_mc.d3.x,y:shoot_mc.d3.y},
               {x:shoot_mc.d4.x,y:shoot_mc.d4.y},
               {x:shoot_mc.d5.x,y:shoot_mc.d5.y},
               {x:shoot_mc.d6.x,y:shoot_mc.d6.y},
               {x:shoot_mc.d7.x,y:shoot_mc.d7.y}
           ],
               type:"thru",
               curviness:0
           },
               ease:Linear.easeNone,
               paused:true
           });




handleMC.buttonMode = true;
handleMC.addEventListener(MouseEvent.MOUSE_DOWN, onDownPoints);
handleMC.addEventListener(MouseEvent.MOUSE_UP, onUpPoints);
handleMC.addEventListener(MouseEvent.CLICK,onClick);
}

//This will tween the progress of your tween 
var autoTween:TweenMax = TweenMax.to(tween, 1, {progress:0.5, repeat:10, yoyo:true});


function onDownPoints(event:MouseEvent):void
{
autoTween.pause();
startMouseY = mouseY - (handleMC.y + (handleMC.height/2))+225;
startMouseX = mouseX - (handleMC.x + (handleMC.width/2))+225;
stage.addEventListener(MouseEvent.MOUSE_MOVE, update);
stage.addEventListener(MouseEvent.MOUSE_UP, onUpPoints);
}

I attached a CS5 fla:

 

You will see that the dragging kind of works, but I think your formula needs a little tweaking. 

Unfortunately I don't know exactly what to recommend there.

Hopefully some of this helps you.

 

waaov thank you so much! you save my butt again :)

Link to comment
Share on other sites

Sorry, we're not typically awake at 5 o'clock in the morning;)

 

The problem is that you are using a TweenMax tween to control the position of handle_mc AND timeline tweens in flash. You can't do both. To test just add to frame1's code:

 

handleMC.x = 10;

 

When you compile you will see none of your timeline animation at all :(

 

---

 

I would suggest removing ALL the frames past frame1 and the guide layer from shoot_mc. 

 

SInce you already have the Bezier tween built you can do the same exact animation you were doing inside the shoot_mc movie clip. 

 

You can literally tween the progress of the Bezier tween you already created kind of like this:

 

function footAnimationFinished():void
{
tween = TweenMax.to(handleMC,.2, { bezier:{values:[
               {x:shoot_mc.d1.x,y:shoot_mc.d1.y},
               {x:shoot_mc.d2.x,y:shoot_mc.d2.y},
               {x:shoot_mc.d3.x,y:shoot_mc.d3.y},
               {x:shoot_mc.d4.x,y:shoot_mc.d4.y},
               {x:shoot_mc.d5.x,y:shoot_mc.d5.y},
               {x:shoot_mc.d6.x,y:shoot_mc.d6.y},
               {x:shoot_mc.d7.x,y:shoot_mc.d7.y}
           ],
               type:"thru",
               curviness:0
           },
               ease:Linear.easeNone,
               paused:true
           });




handleMC.buttonMode = true;
handleMC.addEventListener(MouseEvent.MOUSE_DOWN, onDownPoints);
handleMC.addEventListener(MouseEvent.MOUSE_UP, onUpPoints);
handleMC.addEventListener(MouseEvent.CLICK,onClick);
}

//This will tween the progress of your tween 
var autoTween:TweenMax = TweenMax.to(tween, 1, {progress:0.5, repeat:10, yoyo:true});


function onDownPoints(event:MouseEvent):void
{
autoTween.pause();
startMouseY = mouseY - (handleMC.y + (handleMC.height/2))+225;
startMouseX = mouseX - (handleMC.x + (handleMC.width/2))+225;
stage.addEventListener(MouseEvent.MOUSE_MOVE, update);
stage.addEventListener(MouseEvent.MOUSE_UP, onUpPoints);
}

I attached a CS5 fla:

 

You will see that the dragging kind of works, but I think your formula needs a little tweaking. 

Unfortunately I don't know exactly what to recommend there.

Hopefully some of this helps you.

 

Sorry again. I'm still trouble with bezier. As you can see that fla file "Mouse UP" event doesnt work properly :( Am I doing correct way using to "tween.reverse() after that tween.resume()" 

 

which one is works properly ? also may I use tween.updateTo() method?

  • Like 1
Link to comment
Share on other sites

Sorry, I don't understand your question. I compiled that FLA and it seemed to work perfectly for me - what exactly is not working for you? And you asked about using updateTo() - for what? Sorry, I'm just not sure what you're asking or what the problem is. 

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