If you run some cicode in a task to
display an animation and run the task using TaskNew() you must
ensure that the cicode terminates when the page closes. Any
animation code called inside a task run via TaskNew() will be
directed to the current page. So in the above example when
switching pages the animation now continues on the current page
rather than being bound to the page it started on or terminating
when the page closed. To kill the task when the page closes all
that is required is that you call TaskNew() with the mode parameter
set to 1: for example TaskNew("AnimatePlant", "", 1). |