I have a random walk and I created a checkbox for the animation of the walk.
I want the checkbox to do the followings, but I have not found a solution yet:
- check the checkbox -> the slider of n gets expanded and the animation starts
Here is the MWE:
pts1 = Table[{x, x^2}, {x, -10, 10}]
pts2 = Table[{x, 0.5*x^2}, {x, -10, 10}]
Manipulate[
Graphics[
{{Line[Take[pts1, n]],
Line[Take[pts2, n]]
}},
Axes -> True, PlotRange -> {{-20, 20}, {0, 100}}
],
{{check, False}, {True, False}},
{{n, 21}, 1, 21, 1,
Animator, AnimationRunning -> check
}]
Also, I really want the animation to run for only once. I tried
{{n, 21}, 1, 21, 1, AnimationRepetitions -> 1,
Animator, AnimationRunning -> check
}
but it seems to freeze the animation.
Anyone knows how to deal with the two problems?
check the checkbox -> the slider of n gets expanded and the animation starts
I do not understand the above. As it is now, when I checked the box, it started running OK and the slider was moving. What difference do you want in this part? It seems to do this already. Or are you saying you do not want the slider to show up at all unless the check is checked? $\endgroup$