I have a flash banner on every page in my site. I want it to continue playing rather than reloading when users change pages. Ive read that this can be achieved using flashvars, however, its been quite some time since I did any actionscripting. I've tried looking up tutorials to no avail. Can someone point me in the right direction please.
UPDATED
Thanks for your comments. I have this on frame 1 of my fla file now:
var mySharedObject:SharedObject = SharedObject.getLocal("displayCookie");
if(mySharedObject.data.displayed == true){
gotoAndPlay(currentFrame);
trace("cookie found");
}else{
trace("cookie not found, setting it now");
//do whatever if NOT already been played
mySharedObject.data.displayed = true;
mySharedObject.flush();
}
But I don't know how to give the currentFrame the value it had at the time the page was refreshed. How do I put that in there?
Sorry for my noobness
Building on your SharedObject code, you could do something like this:
On frame 1:
It'll probably be a little more complicated than just using FlashVars. You'll also need to use a little ExternalInterface to get the current frame of the banner once the user navigates to the next page. (Note: I'm using jQuery and swfobject)
First, the javascript would be something like:
Then, in your FLA on frame 1, you would have:
Now, any time you navigate to another page, you just tack on the current frame to the query string using
checkCurrentFrame();