Up to now I always use slide numbers when invoking overlay commands such as \only<...>. But for me this is a bit cumbersome because I must count the slide position in my head. If I can use a string (like \label and \ref mechanism) instead of a slide number, it becomes more elegant, doesn't it?
Is it possible to use a string instead of a slide number when invoking overlay commands such as \only?
Minimal Working Example:
\documentclass{beamer}
\usepackage{pstricks-add}
\usepackage[active,tightpage]{preview}
\PreviewBorder=0pt
\PreviewEnvironment{pspicture}
\begin{document}
\begin{frame}
\begin{pspicture}(6,6)
\pnode(0,0){A}
\pnode(6,0){B}
\pnode(6,6){C}
\pnode(0,6){D}
\pnode(1,1){P}
\pnode(5,1){Q}
\pnode(3,5){R}
\only<5>{\psclip{\pscircle[linestyle=none,dimen=middle](3,3){3}}}
\only<1->{\pspolygon*[linecolor=red](A)(B)(Q)(P)}
\only<2->{\pspolygon*[linecolor=green](B)(C)(R)(Q)}
\only<3->{\pspolygon*[linecolor=blue](C)(D)(R)}
\only<4->{\pspolygon*[linecolor=yellow](D)(A)(P)(R)}
\only<5>{\endpsclip}
\end{pspicture}
\end{frame}
\end{document}
Edit: Oh no. I just knew that the slide numbers in one frame can be reused for other frames. I thought when writing this question that the slide numbers continue from the first slide to the last slide in the beamer document. My question does not make sense now!
My imagination when writing this question is illustrated in the following minimal (NOT) working example:
\documentclass{beamer}
\usepackage{pstricks-add}
\usepackage[active,tightpage]{preview}
\PreviewBorder=0pt
\PreviewEnvironment{pspicture}
\begin{document}
\begin{frame}
\begin{pspicture}(6,6)
\pnode(0,0){A}
\pnode(6,0){B}
\pnode(6,6){C}
\pnode(0,6){D}
\pnode(1,1){P}
\pnode(5,1){Q}
\pnode(3,5){R}
\only<5>{\psclip{\pscircle[linestyle=none,dimen=middle](3,3){3}}}
\only<1->{\pspolygon*[linecolor=red](A)(B)(Q)(P)}
\only<2->{\pspolygon*[linecolor=green](B)(C)(R)(Q)}
\only<3->{\pspolygon*[linecolor=blue](C)(D)(R)}
\only<4->{\pspolygon*[linecolor=yellow](D)(A)(P)(R)}
\only<5>{\endpsclip}
\end{pspicture}
\end{frame}
\begin{frame}
\begin{pspicture}(6,6)
\pnode(0,0){A}
\pnode(6,0){B}
\pnode(6,6){C}
\pnode(0,6){D}
\pnode(1,1){P}
\pnode(5,1){Q}
\pnode(3,5){R}
\only<10>{\psclip{\pscircle[linestyle=none,dimen=middle](3,3){3}}}
\only<6->{\pspolygon*[linecolor=red](A)(B)(Q)(P)}
\only<7->{\pspolygon*[linecolor=green](B)(C)(R)(Q)}
\only<8->{\pspolygon*[linecolor=blue](C)(D)(R)}
\only<9->{\pspolygon*[linecolor=yellow](D)(A)(P)(R)}
\only<10>{\endpsclip}
\end{pspicture}
\end{frame}
\end{document}
I thought it will become cumbersome if the frame order change as I need to modify the slide numbers for each frame.