Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

66 users online



Actionscript problem...

Actionscript problem...

Currently viewing this thread: 1 (0 members and 1 guests)


MrCastle

MrCastle

Official
Status: Offline!

Actionscript problem...

I'm attempting a preloader which is usually god-easy but for some reason,
_root.getBytesLoaded()
stays constant at 70929... and
_root.getBytesTotal()
is 248961...

Here's my actionscript, it's the only actionscript present anywhere in the preloader and it's on a seperate layer of the main timeline.
(Disregard the <?php ?> tags, if I use the code tags it doesn't color or indent...)

PHP:

<?php

var_percent 
0;
while (
var_percent<99) {
    var 
var_loading _root.getBytesLoaded();
    var 
var_total _root.getBytesTotal();
    var 
var_percent var_loading/var_total;
    
trace(var_loading);
    
trace(var_total);
    
trace(var_percent);
    
mc_loadBar._width var_percent*200;
    if (
var_percent>99) {
        
_root.gotoAndStop(5);
    }
}

?>

___________________

"Sam says : Die!"

dionysis

dionysis

Neverside Newbie
Status: Offline!

Dont know if its the cause of your problem or if im even thinking straight but..

var var_percent = (var_loading/var_total)*100;

to get a percentage, otherwise your var_percent will only '.99' rather than '99' ??

MrCastle

MrCastle

Official
Status: Offline!

Oops...
But it doesn't fix the problem unfortunately...

EDIT:
I fixed the problem somehow...
New code:

PHP:

<?php

var_loaded 
= (getBytesLoaded()/getBytesTotal());
mc_loadbar._width var_loaded*200;
if (
var_loaded>0.9) {
    
trace(var_loaded);
    
gotoAndStop(5);
}

?>

___________________

"Sam says : Die!"

Last edited by MrCastle, April 23rd, 2005 04:49 AM (Edited 1 times)

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0076 seconds.