[resolved] Actuate onComplete failing

I’m just working with Actuate.

this:

Actuate.tween(homeButton, 3, { alpha : 1 } );

works fine

this:

Actuate.tween(homeButton, 3, { alpha : 1 } ).delay (3);

also works fine.

But this (as per the actuate docs) fails.

Actuate.tween(homeButton, 3, { alpha : 1 } ).onComplete (trace, "Hello World!");

I realised from the error that it was looking for an array of parameters, but,

Actuate.tween(homeButton, 3, { alpha : 1 } ).onComplete (trace, ["wah"]);

still gets an error: Unknown identifier: trace

Whilst tracing isn’t the hugest issue, it would be helpful to understand where i’m going wrong.

shouldn’t it be this?

Actuate.tween(homeButton, 3, { alpha : 1 } ).onComplete (function() { trace("Hello World"); }, null);
1 Like

thanks @tienery that does work. Actuate docs may be out of date…

I was going to mention that trace() is a shorthand for Log.trace(), but you might still get an error using onComplete(Log.trace, ["Hello, world"]).

The problem is with the “magic” posInfos parameter. If you call Log.trace using reflection, Haxe won’t automagically set posInfos, which will lead to a null pointer error on some platforms.

tl;dr: Ignore this post and stick with tienery’s suggestion.

Yeah, that didn’t work in the Flash target… it’s a bit annoying when using Greensock I would pass a call to the superclass when onComplete, but you can’t do that in Actuate either.

This looks like a bug we should post on the Haxe GitHub issues list, calling trace by reflection should be allowed :frowning: