1

I am displaying an animateinline animation which loops through some frames. I now would like to have a "continue"-button to jump the animation to the next cycle of frames.

If I understand the animate documentation (page 14) correctly the following should do the trick.

But it doesn't. What am I missing?

\documentclass{article} 
\usepackage{filecontents}
\usepackage{tikz}
\usepackage{media9}
\usepackage{animate}

% mytimeline.txt
\begin{filecontents*}{mytimeline.txt}
%-------------------------------------------------------------------  
%[*]:[new frame rate]:[<list of transparencies>][:<JavaScript>]  
% `*' in the first column pauses animation
%-------------------------------------------------------------------  
::0
::1
::2
::3
::4 : anim.myAnim.frameNum=0;  % Loop the firstpart
::5 
::6 
::7 
::8 
::9
::9:  anim.myAnim.frameNum=5; % Loop the second part
\end{filecontents*} 

\begin{document} 
\begin{center} 
\begin{animateinline}[ 
  label=myAnim, 
  autoplay, loop,  
  width=\linewidth, 
  begin={\begin{minipage}[c][5cm][c]{5cm}}, 
  end={\end{minipage}}, 
  timeline=mytimeline.txt
]{4}% 
%create "transparencies", to be arranged according to timeline 
  \multiframe{10}{Number=0+1}{% 
    \begin{tikzpicture}
      \node[font=\Huge] at (0,0) {\Number};
    \end{tikzpicture}
  } 
\end{animateinline}% 
% put a "continue"-button to jump to frame 6 in the animation "myAnim"
\mediabutton[jsaction={anim['myAnim'].frameNum=7;}]{Continue}
\end{center} 
\end{document}

I am using pdflatex and Adobe Reader DC.

ADDITION While I'm playing with it. Even a jsaction={app.alert('Hello World');} does not do anything. Is JavaScript possibly blocked by the reader I'm using?

closed as off-topic by AlexG, egreg, Mensch, Zarko, Stefan Pinnow Jul 30 '17 at 21:06

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Ups. Seems to be a bug. \mediabutton is currently non-functional. Need to look into this. Thanks for reporting! – AlexG Jul 27 '17 at 15:57
  • 1
    New version 0.83, 2017/07/27 of media9 uploaded to CTAN. Should be available within next 48 hours. – AlexG Jul 27 '17 at 17:37
  • 1
    For the impatient: raw.githubusercontent.com/agrahn/media9/master/media9.sty – AlexG Jul 27 '17 at 17:52
  • @AlexG Can you explain what happened? Did Adobe Reader change? – Dr. Manuel Kuehner Jul 27 '17 at 20:43
  • 4
    I'm voting to close this question because the issue it reports has been resolved in the meantime. A new package version is available on CTAN and via the package managers of TeXLive and MiKTeX. – AlexG Jul 30 '17 at 19:49