Does my class reinvent AnimationAction's methods?

I have several animations on my character and want to always transition smoothly from running to walking to idling to punching, etc. at any time without discontinuous jumps (without waiting on a previous transition to finish). I couldn’t find a way to achieve this with AnimationAction's many methods and properties. Can “vanilla” AnimationActions achieve the following, i.e. can my ActionHandler class be replaced with a few calls to AnimationAction methods?

class ActionHandler {
	constructor(actions) {
		this.actions = actions;
		this.duration = Infinity;
		for (var a of this.actions) {;
			a.enabled = false;
			a.weight = 0;

	play(currentAction, duration) {
		this.currentAction = currentAction;
		this.duration = duration;

	update(deltaTime) {
		// Fade in currentAction
		var deltaWeight = deltaTime / this.duration;
		if (this.currentAction) {
			this.currentAction.enabled = true;
			this.currentAction.weight = Math.min(this.currentAction.weight + deltaWeight, 1);
		// Fade out other actions
		for (var a of this.actions) {
			if (a !== this.currentAction && a.enabled) {
				a.weight -= deltaWeight;
				if (a.weight <= 0) {
					a.weight = 0;
					a.enabled = false;
					a.time = 0;


// constructor()
this.actionHandler = new ActionHandler([this.idleAction, this.runAction])
// step()
if (running) {, 1.0);
else {, 1.0);
// render()

Have you tried using methods like AnimationAction.fadeIn() or AnimationAction.fadeOut? There are also the so called cossFade* methods which provide a nice API for smoothly switch from one action to an other. The following example uses these methods.

Is appears that fadeIn and fadeOut assume that animationAction.weight is 0 or 1, respectively. They ignore the current weight, which might be somewhere between 0 and 1.
The crossFade methods call the fade methods, so they inherit the same problem.
Am I thinking about this incorrectly? Is this the normal way of creating animations?

Well, there are many scenarios where the current active animation always has a weight of 1. The mentioned API is intended for such use cases.

If that is not the case in your app, you can still implement a custom transition like shown above. I’m also doing something similar in my current project^^

Ah, good to hear I’m not alone.
Perhaps AnimationAction is for animations that have similar start and end poses, so that you can queue up a number of actions and wait until they’re finished to move on to the next cutscene or whatever. But if that’s the case, I still don’t see things like onFinish and an actual queue, so maybe I’m wrong.