Opened 10 years ago

Last modified 6 years ago

#14636 assigned defect

Chained animation not so chained

Reported by: gaxweb Owned by: dylan
Priority: high Milestone: 1.15
Component: fx Version: 1.7.1
Keywords: fx, animation, chaining Cc:
Blocked By: Blocking:


A chained animation works fine on the first run. But after it has finished once, calling .start() on it again, the chained animation is not working right. It appears to only ever play the last entry in the array (found that out after switching them around) anymore.

Demo by Karl Tiedt here: My code example:

Change History (6)

comment:1 Changed 10 years ago by Karl Tiedt

Looking at the chain object... there is no handling for gotoStart and resetting _current to _animations[0]

		play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
			if(!this._current){ this._current = this._animations[this._index = 0]; }
			if(!gotoStart && this._current.status() == "playing"){ return this; }
			var beforeBegin = connect.connect(this._current, "beforeBegin", this, function(){
				onBegin = connect.connect(this._current, "onBegin", this, function(arg){
					this._fire("onBegin", arguments);
				onPlay = connect.connect(this._current, "onPlay", this, function(arg){
					this._fire("onPlay", arguments);
			this._onAnimateCtx = connect.connect(this._current, "onAnimate", this, "_onAnimate");
			this._onEndCtx = connect.connect(this._current, "onEnd", this, "_onEnd");, arguments);
			return this;

comment:2 Changed 10 years ago by Karl Tiedt

Believe this is enough to illustrate that is infact the problem:

updating _onEnd handler to reset _current and _index appears to suffice

comment:3 in reply to:  2 Changed 10 years ago by gaxweb

Replying to ktiedt:

I've applied your concept to my code, and it fixed that problem. It became evident though, that dojo.fx.combine has the same problem, since my ani_dissemble animation didn't rewind itself either after running it for the first time. Adding the manual resets fixed it there as well.

comment:4 Changed 8 years ago by dylan

Milestone: tbd1.11
Owner: changed from Bryan Forbes to dylan
Status: newassigned

comment:5 Changed 7 years ago by dylan

Milestone: 1.111.12

comment:6 Changed 6 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.