\RequirePackage{atbegshi}
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[frenchb]{babel}
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usepackage{animate}
\usepackage{hyperref}
\hypersetup{pdfpagemode=FullScreen}
\usepackage{xifthen}
\definecolor{forestgreen}{rgb}{0.13,0.54,0.13}
\mode<presentation>{\usetheme{CambridgeUS}}

\newcounter{d}
\setcounter{d}{0}

\begin{document}

\begin{frame}[fragile]{Translation horizontale}
	\begin{center}
		\begin{animateinline}[loop, poster = first, controls]{30}
			\whiledo{\thed<21}{
 				\begin{tikzpicture}
					\clip (-4,-1.25) rectangle (4,5);
					\draw[help lines,thin,dashed] (-3.8,-0.4)grid (3.8,4.8);
					\draw[->,>=latex] (-4,0)--(4.5,0) node[below] {$x$};
					\draw[->,>=latex] (0,-0.5)--(0,4.55) node[left] {$y$};
					\draw[smooth] plot(\x,{(\x)^2});
					\draw[blue,thick,smooth] plot (\x,{(\x-(\thed/2)+5)^2});
					\pgfmathparse{-5+\thed/2} \let\z\pgfmathresult
					\pgfmathparse{abs(\z)} \let\zz\pgfmathresult
					\node[draw,rounded corners,fill=yellow!30!brown!20] at (-2,-0.5)
						{$y=(x \ifnum\thed>10 - \else + \fi \zz)^2$};
					\fill[forestgreen] ({-5+\thed/2},0) node[below right]{$S$};
					\draw[forestgreen,thick] ({-5+\thed/2},-0.5)--({-5+\thed/2},5);
					\ifthenelse{\thed=10}{}{
						\draw[->,>=latex,red,thick] (1,1)--({1+(-5+\thed/2)},1);
						\fill[red] (1,1) circle (2pt);
						}
				\end{tikzpicture}
				\stepcounter{d}
				\ifnum\thed<21 \newframe \fi
		    	}
	 	\end{animateinline}    
	\end{center}
\end{frame}
\end{document}