Question: 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?

Answer: 
> 
> I want the slider to be hidden at first, and to be shown only when I
>  check the checkbox
> 
> 
> 

In this case I suggest you use `OpenerView`

[![enter image description here](https://i.stack.imgur.com/XHNIg.gif)](https://i.stack.imgur.com/XHNIg.gif)

code
----

```
pts1 = Table[{x, x^2}, {x, -10, 10}]
pts2 = Table[{x, 0.5*x^2}, {x, -10, 10}]

Manipulate[
 tick;

 g = Graphics[{{Line[Take[pts1, n]], Line[Take[pts2, n]]}}, 
   Axes -> True, PlotRange -> {{-20, 20}, {0, 100}}, 
   ImageSize -> {300, 200}];
 If[state == "auto" && n < max,
  n++;
  tick = Not[tick]
  ];
 Grid[{{Row[{"n = ", n}]}, {g}}]
 ,

 OpenerView[{"open",
   Grid[{{
      Row[{Button[
         Style["run", Small], {state = "auto"; If[n == max, n = 1]; 
          tick = Not[tick]}, ImageSize -> {30, 30}],
        Button[
         Style["stop", Small], {state = "manual"; tick = Not[tick]}, 
         ImageSize -> {30, 30}]}]
      ,
      Row[{
        "n ", 
        Manipulator[
         Dynamic[n, {n = #; state = "manual"; 
            tick = Not[tick]} &], {0, 21, 1}, ImageSize -> Tiny]}
       ]}
     }, Spacings -> {1, 1}
    ]
   }]
 ,
 {{tick, False}, None},
 {{state, "manual"}, None},
 {{n, 0}, None},
 {{max, 21}, None},
 ControlPlacement -> Above,
 TrackedSymbols :> {tick}
 ]

```
One possibility is to nest `Manipulate`

```
pts1 = Table[{x, x^2}, {x, -10, 10}];
pts2 = Table[{x, 0.5*x^2}, {x, -10, 10}];

Manipulate[
 If[check,
  Manipulate[
   Graphics[
    {Line[pts1[[1 ;; n]]], Line[pts2[[1 ;; n]]]},
    Axes -> True,
    PlotRange -> {{-20, 20}, {0, 100}}],
   {{n, 21}, 1, 21, 1, Animator,
    AnimationRepetitions -> 2,
    AnimationRunning -> True},
   Paneled -> False],
  Graphics[
   {Line[pts1], Line[pts2]},
   Axes -> True,
   PlotRange -> {{-20, 20}, {0, 100}}]],
 {{check, False, "Enabled"}, {True, False}}]

```