callback - kineticjs tween: continue code after tween finished -


how have change code last 2 lines after tween finished? @ moment last 2 log, sound plays , @ same time tween start. , while sound playing teen finished , last log ("tween finished").

var tween = new kinetic.tween({             node: mynode,              duration: 100,             x: 100,             y: 200,             scalex: 80,             scaley: 80,             onfinish: function() {                 console.log("tween finished");             } }); tween.play(); //the next lines should executed after onfinish-event console.log("this should first log"); console.log("executed before 'tween finished'"); .. e.g. play sound 

just put in function , call within onfinish:

var func2 = function() {     console.log("this should first log");     console.log("executed before 'tween finished'");     // .. e.g. play sound }  var tween = new kinetic.tween({         node: mynode,          duration: 100,         x: 100,         y: 200,         scalex: 80,         scaley: 80,         onfinish: function() {             console.log("tween finished");             func2();         } }); tween.play(); 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -