A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Preloader not working.

  1. #1
    Senior Member [SH]Doc's Avatar
    Join Date
    May 2002
    Location
    Belgium
    Posts
    149

    Preloader not working.

    I'm working on a new website and wrote a preloader for it. It's only 46 Kb so I set the speed in the streamingtest to 14.4K/sec.

    Yesterday, when I tested it, the loader worked. but now I test it again, and it doesn't work, any ideas what might cause this, or will it when I publish it?

    this is the code of the preloader
    Code:
    lBytes = _root.getBytesLoaded();
    tBytes = _root.getBytesTotal();
    percentLoaded = Math.floor((lBytes/tBytes)*100);
    
    loader.bar._xscale = percentLoaded
    loader.percent.text = percentloaded
    loader.textfield.text = Math.floor(lBytes/1024) + "Kb of " + Math.floor(tBytes/1024) + "Kb loaded."
    
    if (lBytes>=tBytes && tBytes>0) {
    	if (count>=12){
    		gotoAndPlay("main");
    	}else{
    		count++;
    		gotoAndPlay("preload");
    	}
    	}else{
    		gotoAndPlay("preload");
    }
    I also added the .fla so if anyone could take a look at it, would be great
    Attached Files Attached Files

  2. #2
    Senior Member [SH]Doc's Avatar
    Join Date
    May 2002
    Location
    Belgium
    Posts
    149
    I've looked at Modulator's thread, but still can't get it to work

  3. #3
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    You got 32K in the first frame. That's that component. It has to load first, in frame 1. Put some content on the last frame so there is something to load, but change the loader code to this first, then test.

    Code:
    lBytes = _root.getBytesLoaded();
    tBytes = _root.getBytesTotal();
    percentLoaded = Math.floor((lBytes/tBytes)*100);
    
    loader.bar._xscale = percentLoaded
    loader.percent.text = percentloaded
    loader.textfield.text = Math.floor(lBytes/1024) + "Kb of " + Math.floor(tBytes/1024) + "Kb loaded."
    
    if (lBytes>=tBytes) {
    		gotoAndPlay("main");
    	}else{
    		gotoAndPlay("preload");
    }

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