Question: The problem with animation within the Plot component


I want to show an animation in Plot component on Button press.

Action when clicked for the button :

use DocumentTools in

Do(%Plot0 = dis);
SetProperty(Plot0, play, true, refresh=true);

end use;

Variable dis was calculated earlier:

B := animate(plot, [u(t, x), x = xmin .. xmax], t = tmin .. tmax, frames = n):
dis:=display(B, insequence = true):

However, the first press on the button gives static first frame. Only second press starts the animation.
What's the problem with my code?

Please Wait...