I would like to input a variable using a form and then use that variable in an animation. A simple example is shown in the code below.
Clear["Global`*"]
form = FormFunction["length" -> "Number", # &];
datin = form[];
len = datin[["length"]] // N;
\[Theta][t_] = Sin[2 \[Pi] t];
Animate[Graphics[{Disk[{0, 0}, .15],
Disk[{l Sin[.2 \[Theta][t]], -l Cos[.2 \[Theta][t]]}, .15] /.
l -> len,
Line[{{0, 0}, {l Sin[.2 \[Theta][t]], -l Cos[.2 \[Theta][t]]}}] /.
l -> len}, PlotRange -> {{-5, 5}, {-9, 1}}], {t, 0, 10, .01},
AnimationRate -> 1, AnimationRunning -> False]
But it seems that the animated graphic attempts to run as soon as the notebook is executed and results in an error message and the graphic painted pink until the data is entered. Is there some way to keep this error from occurring?