A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: F8 - files load, but preloader progress bar doesn't appear

  1. #1
    Junior Member
    Join Date
    Nov 2005
    Posts
    18

    F8 - files load, but preloader progress bar doesn't appear

    Can anyone tell me why the preloader script below might not be working correctly in all browsers? It definitely loads the files properly, but the progress bar does not show in firefox. It just shows a blank screen until the files are 100% loaded, then the enter site logo appears.

    I have tried the following things:

    1. Using relative vs absolute file paths for the external swfs makes no difference to the behaviour.
    2. Changed publish settings to export AS classes in other than the first frame - didn't have any anyway. No change.
    3. Unchecked "export in first frame" for absolutely everything. Tried both checking and unchecking this for the actual loader_mc. No change.

    I'd post my fla instead of code, but I'm using Flash 8 and can't save any earlier than MX2004 and people don't really seem to look at them that much when I post them. If anyone would like to see, I will upload.

    Please help, I'm at wit's end!


    Preload code (on main timeline)
    Code:
    stop();
    
    onEnterFrame = function() 
       {
    			
       if(!isNan(Percent))
          {	
    
          Total = Math.floor (616);
    		
    	//original code using getBytesTotal to get the total
    	//preloader behaves exactly the same in firefox no matter
    	//which method i use.
    	/*
    	(load_container._level1.getBytesTotal()/1000)+
    	(load_container._level2.getBytesTotal()/1000)+
    	(load_container._level3.getBytesTotal()/1000)+
    	(load_container._level4.getBytesTotal()/1000)+
    	(load_container._level5.getBytesTotal()/1000)+
    	(load_container._level6.getBytesTotal()/1000)+
    	(load_container._level7.getBytesTotal()/1000)+
    	(load_container._level8.getBytesTotal()/1000)+
    	(load_container._level9.getBytesTotal()/1000)+
    	(load_container.getBytesTotal()/1000);
    	*/
    		
    	
          Loaded = Math.floor (load_container._level1.getBytesLoaded()/1000)+
    	(load_container._level2.getBytesLoaded()/1000)+
    	(load_container._level3.getBytesLoaded()/1000)+
    	(load_container._level4.getBytesLoaded()/1000)+
    	(load_container._level5.getBytesLoaded()/1000)+
    	(load_container._level6.getBytesLoaded()/1000)+
    	(load_container._level7.getBytesLoaded()/1000)+
    	(load_container._level8.getBytesLoaded()/1000)+
    	(load_container._level9.getBytesLoaded()/1000)+
    	(load_container.getBytesLoaded()/1000);
    		
          Percent = Math.floor((Loaded/Total)*100);
    
    	//trace ("total = " +Total);
    	//trace ("loaded = " +Loaded);
    	//trace ("percent = " +Percent);
    
    
    	if(Loaded != Total && Total >= 4) 
    	   {
               loader_mc.gotoAndStop(Percent);
    		   	}
    	   if (Percent == 100 && Total > 4)
    	      {
                  delete this.onEnterFrame
    	      loader_mc.gotoAndStop(Percent);
    	      }
    		
    	   }
       }
    Loadfiles code - sitting on the container movie (which is on the stage) at the moment because I've been experimenting with moving it around. Not the best place, but where I put it doesn't seem to make a difference to the behaviour.


    Code:
    onClipEvent (load) 
    	{
    	loadMovieNum("loop.swf", 1);
    	loadMovieNum("bottlesmasked.swf",2);
    	loadMovieNum("first.swf",3);
    	loadMovieNum("gallery.swf",4);
    	loadMovieNum("location.swf",5);
    	loadMovieNum("menu.swf",6);
    	loadMovieNum("private.swf",7);
    	loadMovieNum("winelist.swf",8);
    	loadMovieNum("nav.swf", 9);
    	
    	}
    
    onClipEvent (enterFrame) 	
    	
    	{
    	//make the loaded movies invisible
        for (i=1; i<10; i++) {
            set("_level"+i+"._visible", false);}
        }

  2. #2
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    Why are you loading onto levels?
    Try loading onto MovieClips. I personally hate levels, they are just confusing.

    You can post your Flash 8 .fla file, most of us have got the new version of Flash too.
    Altruism does not exist. Sustainability must be made profitable.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center