rockman82
03-07-2007, 04:20 AM
Could someone please tell me what is wrong with this code? I'm making a preloader bar ("loaderbar" in the code) which will extend from 0 pixels to 165 pixels when the load progress reaches 100%. Then the playhead will move to frame 2, triggering the animation, buttons, etc. to be displayed. Right now, nothing quite works, and I haven't found the probelm. Also, if there is a simpler or more efficient way to do this, it would be much appreciated. Thanks.
_root.stop();
_global.Y = 0;
function loadprogress () {
_global.Y = Math.ceil(getBytesLoaded() / getBytesTotal());
_root.loader.loaderbar._width = (_global.Y)*(165);
updateAfterEvent();
};
loadinterval = setInterval (loadprogress, 50);
if (_global.Y >= 1) {
clearInterval (loadinterval);
_root.gotoAndStop(2);
};
_root.stop();
_global.Y = 0;
function loadprogress () {
_global.Y = Math.ceil(getBytesLoaded() / getBytesTotal());
_root.loader.loaderbar._width = (_global.Y)*(165);
updateAfterEvent();
};
loadinterval = setInterval (loadprogress, 50);
if (_global.Y >= 1) {
clearInterval (loadinterval);
_root.gotoAndStop(2);
};