\documentclass{article}
\usepackage[inline]{asymptote}
%\usepackage{asymptote}
\usepackage{animate}
\begin{document}

Here is an inline PDF movie, generated with the commands
\begin{verbatim}
pdflatex inlinemovie
asy inlinemovie
pdflatex inlinemovie
\end{verbatim}

\begin{center}
\begin{asy}
import animate;
animation A=animation("movie1");
real h=2pi/10;

picture pic;
unitsize(pic,2cm);
for(int i=0; i < 10; ++i) {
  draw(pic,expi(i*h)--expi((i+1)*h));
  A.add(pic);
}
label(A.pdf("controls",delay=50,keep=!settings.inlinetex));
\end{asy}
%Uncomment the following line when not using the [inline] package option:
%\ASYanimategraphics[controls,loop]{20}{movie1}{}{}
\end{center}

And here is another one, clickable but without the control panel:
\begin{center}
\begin{asy}
import animate;
animation A=animation("movie2");
real h=2pi/10;

picture pic;
unitsize(pic,2cm);
for(int i=0; i < 10; ++i) {
  draw(pic,expi(-i*h)--expi(-(i+1)*h),red);
  A.add(pic);
}
label(A.pdf(keep=!settings.inlinetex));
\end{asy}
%Uncomment the following line when not using the [inline] package option:
%\ASYanimategraphics[controls,loop]{10}{movie2}{}{}
\end{center}

\end{document}
