Jump to content

endless loop with - while(tween.isRunning) { }


Rocco
 Share

Recommended Posts

while(tween.isRunning) { }

i want to be sure that the tweening is over and then continue with the next lines in the function.

is it possible somehow?

 

i'm aware of tween.onComplete, but i don't want to use it this time, cause this is in a function who calls themself in some circumstances and calling another function with onComplete gives me a lot of trouble and unexpected behavior in my current situation.

Link to comment
Share on other sites

Hey Rocco,

Jorasso is right. This is an endless loop. You can't do this in javascript. If somebody do this they do not have an understanding for the language, maybe you should work on it to make your life easier! With this being said you should really try the solution with onComplete, there are dozens and dozens of people who use it and I can assure you it is working as expected and you should really, really think about your code instead of avoiding the onComplete signal. Don't be lazy ;) Have fun!

Link to comment
Share on other sites

thank you both, it works now with onComplete and i have gained more experience with javascript today.

sorry if it was a dumb question, but i have a rather complex construct which was finally working perfekt after a lot of tweaking

and then i inserted the tweenings somewhere in the middle and suddenly it was buggy like hell, because of the fact that the tweenings are not finished during the function is called again.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...