XWidgetSoft Forum
https://bbs.xwidget.com/

HELP: Perform action once an animation has completed: CLOSED
https://bbs.xwidget.com/viewtopic.php?f=8&t=6081
Page 1 of 1

Author:  yereverluvinuncleber [ December 24th, 2015, 4:43 am ]
Post subject:  HELP: Perform action once an animation has completed: CLOSED

When an animation or effect has completed it should be possible to call another effect or animation automatically.

eg.

You run this command to fade a layer:

aboutUsLayer.FadeTo(255,1);

Then you want the following action to be carried out only when the above animation has completed.

aboutUsLayer.visible = true;

The two cannot happen simultaneously as the fade effect is lost so one must happen after the other.

Other engines allow subsequent animations to stack one on top of another by allowing you to specify the routine/function to run when the animation is completed. The second action can then be placed in the subsequent function.

How is this achieved in Xwidgets?

Author:  yereverluvinuncleber [ December 25th, 2015, 10:40 pm ]
Post subject:  Re: HELP: Perform an action once an animation has completed

It seems it can be done via the setTimeoutcommand. It is not ideal but it is do-able.

aboutUsLayer.FadeTo(255,1);
setTimeout("fadeDone",1000); //the timeout in milliseconds must match the fade measured in seconds.

function fadeDone () {
aboutUsLayer.visible = false;
}

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/