I am trying to get my flash header to only load one time per visit to a website. I tried this first..
onClipEvent (load)
{
total = _root.getBytesTotal();
}
onClipEvent (enterFrame)
{
loaded = _root.getBytesLoaded();
percent = int(loaded/total*100);
text = percent+"%";
gotoAndStop(percent);
if ((loaded == total) && (_root.par == "skip"))
{
_root.gotoAndStop(160); // usually the frame number where animation finishes
} else if (loaded == total) {
- onClipEvent (load)
- {
-
- total = _root.getBytesTotal();
-
- }
-
- onClipEvent (enterFrame)
- {
-
- loaded = _root.getBytesLoaded();
-
- percent = int(loaded/total*100);
-
- text = percent+"%";
-
- gotoAndStop(percent);
-
- if ((loaded == total) && (_root.par == "skip"))
- {
-
- _root.gotoAndStop(160); // usually the frame number where animation finishes
-
- } else if (loaded == total) {
-
This skipped the animation part, then......
if(_root.par == "skip"){
gotoAndStop();
}
-
- if(_root.par == "skip"){
- gotoAndStop();
- }
-
I put this on layers I wanted to skip...
in the html i placed ...&par=skip
works great for skipping, but I think i was mislead. Everything I did not want to play on other pages dosn't but it still loads "shows the load screen" once on every page. Why is that?
Do I need to use visitcheck? somthing like this maybe?
function VisitCheck() {
var numDays = 1;
// number of days until you make your visitors re-view "open"
var currDateObj = new Date();
var currentMS = currDateObj.getTime();
var myLocalSO = sharedobject.getLocal("visitRecord");
if (myLocalSO.data.visited == null) {
myLocalSO.data.dateMS = currentMS;
myLocalSO.data.visited = 1;
// your action for first visit here
trace("open");
_root.gotoAndPlay("open");
} else {
if (currentMS-myLocalSO.data.dateMS<1000*60*60*24*numDays) {
// your action for second and more visit to skip to diff
// frame on the timeline or whatever you need
trace("final");
_root.gotoAndPlay("final");
} else {
_root.gotoAndPlay("open");
}
// you may (or may not) want to update myLocalSO.data.dateMS here or in one
of the above conditionals
}
}
VisitCheck();
- function VisitCheck() {
- var numDays = 1;
- // number of days until you make your visitors re-view "open"
- var currDateObj = new Date();
- var currentMS = currDateObj.getTime();
- var myLocalSO = sharedobject.getLocal("visitRecord");
- if (myLocalSO.data.visited == null) {
- myLocalSO.data.dateMS = currentMS;
- myLocalSO.data.visited = 1;
- // your action for first visit here
- trace("open");
- _root.gotoAndPlay("open");
- } else {
- if (currentMS-myLocalSO.data.dateMS<1000*60*60*24*numDays) {
- // your action for second and more visit to skip to diff
- // frame on the timeline or whatever you need
- trace("final");
- _root.gotoAndPlay("final");
- } else {
- _root.gotoAndPlay("open");
- }
- // you may (or may not) want to update myLocalSO.data.dateMS here or in one
- of the above conditionals
- }
- }
- VisitCheck();
-
-
Any help would greatful,
Thanks
P.S. I tried to search a previous post for this but found nothing, if found please pass along.
Moderator Remark: added code tags