Web Hosting Talk







View Full Version : making flash play anim only once per session


GotGameServers
04-12-2005, 11:05 AM
I finally found out how to do this and thought I would pass it on for those that dont know. Also - does anyone know how to make the sound frame only play once per session?

put this in the first frame actionscript of your flash movie

function checkSO()
{
// If a shared object called siteSO already exists this will retrieve it otherwise it
// creates a new shared object called siteSO
var SO = SharedObject.getLocal("siteSO");
if(SO.data.visitedAlready)
{
gotoAndPlay("end");
}
else
{
SO.data.visitedAlready = true;
SO.flush();
}
}
// Put that and this in the first keyframe of your movie, before the intro
checkSO();

then name the last frame of your movie "end"

does anyone know how to make the sound frame do the same thing?

Ackoo-jt
04-13-2005, 02:05 AM
if you add it to movie_full and make sure that its not in movie_main it should work ;)