Flash Cache Question
- Started
- Last post
- 9 Responses
- codfather
Does anyone know if it is possible to play a flash movie only once - even if you reload the page. i.e. some code that sees the cached swf and tells the movie not to load?
- rabattski0
don't think it's possible that flash can check the visitors drive, i dunno you can use meta tags against caching but that's not foolproof.
- codfather0
Hmmm. Thought it prob wasn't doable - thanks man.
- loahn0
You can use SharedObjects to store 'cookie'-like information on a users machine. Read up on it in the Flash AS Reference guide.
- stewart0
sounds like that's doable
try cookies or flash shared objects (flash cookies)
- rabattski0
oh now i get the question! totally misunderstood you. yep. cookies. like the other people already said.
- stewart0
haha rabattski
sometimes i read the responses first before i read the question. doh!
- Timson0
Add a variable in the embed source of your flashmovie.
Now you can use php or other to change it from "do" to "dont".
embed src="yourmovie.swf?playflash=don...
inside your flashmovie on the first frame read the variable and make it send the movie to the appropriate point.
Is this clear?
Otherwise check the code on this page for more insight.
http://www.dfrog.be/woningbouwei…
- codfather0
ok guys, thanks! will give it a go but probably come back crying...
- loahn0
This code may need tweaking but its the general idea.
[first] frame action:
// create the SharedObject 'cookie'
var playCheck:SharedObject = SharedObject.getLocal("hasPlayed...
// check for any previous data stored from a previous visit
if (playCheck.data.hasPlayed != undefined && playCheck.data.hasPlayed != true) {
// this code block runs if it is the 'first-play'
// as hasPlayed cannot be found or is FALSE, the
// following line of code creates it and assignes a
// boolean of TRUE to it.
playCheck.data.hasPlayed = true;
// then write your code here for the default 'first-play' actions
} else {
// write the code that omits the default 'first-play' actions
}