Group Abstract Group Abstract

Message Boards Message Boards

[?] Control animations with FinishDynamic[]?

Posted 8 years ago
POSTED BY: W. Craig Carter

Craig,

you need to add a Method-> "Queued" to the go button

DynamicModule[{walkers = ConstantArray[{{0, 0}}, 50], 
  animate = False}, Column[{Row[{Button["Go", animate = True;
      While[animate, walkers = updateRandomWalk /@ walkers;
       FinishDynamic[];], Method -> "Queued"], 
     Button["Stop", animate = False, Method -> "Preemptive"]}], 
   Dynamic[Graphics[displayWalker /@ walkers, 
     PlotRange -> 50 {{-1, 1}, {-1, 1}}]]}]]
POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard