Jump to content
Search Community

Simple Tween onStart Problem [SOLVED]

jegelskerpingviner test
Moderator Tag

Recommended Posts

publicfunction changePosition()

{

newYValue = blah;

...

TweenLite.to(content, EASE, { y:newYValue, ease:Regular.easeOut});

}

 

publicfunction mouseUpHandler(evt:MouseEvent)

{

func1();

}

 

publicfunction func1():void

{

newYValue = blah;

...

trace("func1 started");

TweenLite.to(content, EASE, { y:newYValue, ease:Regular.easeOut, onStart:hi });

trace("func2 ending");

}

 

public function hi():void

{

trace("onStart worked successfully");

}

 

Essentially this is what happens: changePosition is called whenever an object is being dragged. So new tweens are overwriting each other whenever the mouse moves (this should be fine and works how I want it).

 

Once the user lets go of the drag, mouseUpHandler is called, which calls func1 which does a bunch of calculations and calls a new tween on content (so it should overwrite any old tween from changePosition()). I never see the trace "onStart worked successfully". The two traces in func1() are both called, and it obviously is calling the TweenLite call between the two traces...

 

If I move the ", onStart:hi" part of the Tween up to the tween in changePosition(), hi() gets called everytime the mouse moves, as it should.

 

Any ideas of what I'm doing incorrectly? hi() NEVER gets called (not 30 seconds later)...

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.
×
×
  • Create New...