Hi,
I've chained some animations together and am wondering how I can get the normal javascript code to wait for their completion before continuing. At the moment the calls after 'play()' are firing whilst the animation is in progress.
I'm clearly missing something simple, so any advice appreciated!
Adam
I've chained some animations together and am wondering how I can get the normal javascript code to wait for their completion before continuing. At the moment the calls after 'play()' are firing whilst the animation is in progress.
I'm clearly missing something simple, so any advice appreciated!
Adam
Code: Select all
var combined_anim = dojo.fx.chain(potion_ready_anims);
dojo.connect(combined_anim, 'onEnd', function(node) {
// Ideally need to have this onEnd method trigger the final few methods
dojo.destroy('potion_' + potion_id); });
combined_anim.play();
// These need to run after the animation has completed or somehow be inserted into the chain at the correct point
this.updateDispenser(tube1, tube2, tube3, tube4, tube5);
this.cupboards[player_id].addToStockWithId(potion_type, potion_id, 'potion_' + potion_id);