# Beamer and newenvironments

I'm trying to combine beamer overlays and newenvironments:

\newcounter{scount}
\setcounter{scount}{0}
\newenvironment{sitem}[1]
{%before
\def\data{#1}
\stepcounter{scount}
\onslide<\value{scount}->{\item \data}
\comment
}{
\endcomment
}


and:

\begin{itemize}
\begin{sitem}{data}asdf1\end{sitem}
\begin{sitem}{data}asdf2\end{sitem}
\begin{sitem}{data}asdf3\end{sitem}
\end{itemize}


But beamer seems to ignore the \onslide command and shows all data values at once instead of data for asdf1, asdf2, asdf3 after each other.

-

Perhaps a better way to achieve what you want is as follows:

\begin{itemize}[<+->]
\item Foo
\item Bar
\end{itemize}

-

I'm not sure if this is the cause of the unexpected behavior, but you can eliminate the extra counter with incremental overlay specifications.

\newenvironment{sitem}[1]
{%before
\item<+-> #1
\comment
}{
\endcomment
}

-