Header flash only load once Please!

  • mrblue1482
  • Born
  • Born
  • mrblue1482
  • Posts: 1

Post 3+ Months Ago

I am trying to get my flash header to only load one time per visit to a website. I tried this first..
ACTIONSCRIPT Code: [ Select ]
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) {
 
  1. onClipEvent (load)
  2. {
  3.  
  4.    total = _root.getBytesTotal();
  5.  
  6. }
  7.  
  8. onClipEvent (enterFrame)
  9. {
  10.  
  11.    loaded = _root.getBytesLoaded();
  12.  
  13.    percent = int(loaded/total*100);
  14.  
  15.    text = percent+"%";
  16.  
  17.    gotoAndStop(percent);
  18.  
  19.    if ((loaded == total) && (_root.par == "skip"))
  20.    {
  21.  
  22.       _root.gotoAndStop(160); // usually the frame number where animation finishes
  23.  
  24.       } else if (loaded == total) {
  25.  


This skipped the animation part, then......
ACTIONSCRIPT Code: [ Select ]
 
if(_root.par == "skip"){
   gotoAndStop();
    }
 
  1.  
  2. if(_root.par == "skip"){
  3.    gotoAndStop();
  4.     }
  5.  

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?

ACTIONSCRIPT Code: [ Select ]
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();
 
 
  1. function VisitCheck() {
  2. var numDays = 1;
  3. // number of days until you make your visitors re-view "open"
  4. var currDateObj = new Date();
  5. var currentMS = currDateObj.getTime();
  6. var myLocalSO = sharedobject.getLocal("visitRecord");
  7. if (myLocalSO.data.visited == null) {
  8. myLocalSO.data.dateMS = currentMS;
  9. myLocalSO.data.visited = 1;
  10. // your action for first visit here
  11. trace("open");
  12. _root.gotoAndPlay("open");
  13. } else {
  14. if (currentMS-myLocalSO.data.dateMS<1000*60*60*24*numDays) {
  15. // your action for second and more visit to skip to diff
  16. // frame on the timeline or whatever you need
  17. trace("final");
  18. _root.gotoAndPlay("final");
  19. } else {
  20. _root.gotoAndPlay("open");
  21. }
  22. // you may (or may not) want to update myLocalSO.data.dateMS here or in one
  23. of the above conditionals
  24. }
  25. }
  26. VisitCheck();
  27.  
  28.  


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

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 12 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.