smerbie
06-03-2004, 01:45 PM
Hi,
I have a preloader that I am attempting to use. The presentation I am developing uses features that will only work with Flash Player 7 (and AS 2.0). When I run my main swf, the preloader does not work. Instead of seeing "23%" (or whatever) in the progress bar, I see "NaN%" and the progress bar does not grow--it's fully grown. I have my preloader placed in frame 1 of my main movie and then the rest of my presentation in frame 2. I have included the AS that is contained in my preloader clip:
//frame 1:
_parent.stop();
//frame 2:
kBytesLoaded = (_parent.getBytesLoaded() +
_level1.getBytesLoaded()) / 1024;
kBytesTotal = (_parent.getBytesTotal () +
_level1.getBytesTotal ()) / 1024;
kBytesRemaining = kBytesTotal - kBytesLoaded;
percentLoaded = 100 * kBytesLoaded / kBytesTotal;
percentRemaining = 100 - percentLoaded;
progress = Math.floor(percentLoaded) add "%";
loadBar._xScale = percentLoaded;
//frame 3:
if (percentLoaded < 99){
gotoAndPlay(2);
} else {
_parent.play();
stop();
}
Is there some code here that needs to be updated to work w/ 7?
Thanks in advance!!
I have a preloader that I am attempting to use. The presentation I am developing uses features that will only work with Flash Player 7 (and AS 2.0). When I run my main swf, the preloader does not work. Instead of seeing "23%" (or whatever) in the progress bar, I see "NaN%" and the progress bar does not grow--it's fully grown. I have my preloader placed in frame 1 of my main movie and then the rest of my presentation in frame 2. I have included the AS that is contained in my preloader clip:
//frame 1:
_parent.stop();
//frame 2:
kBytesLoaded = (_parent.getBytesLoaded() +
_level1.getBytesLoaded()) / 1024;
kBytesTotal = (_parent.getBytesTotal () +
_level1.getBytesTotal ()) / 1024;
kBytesRemaining = kBytesTotal - kBytesLoaded;
percentLoaded = 100 * kBytesLoaded / kBytesTotal;
percentRemaining = 100 - percentLoaded;
progress = Math.floor(percentLoaded) add "%";
loadBar._xScale = percentLoaded;
//frame 3:
if (percentLoaded < 99){
gotoAndPlay(2);
} else {
_parent.play();
stop();
}
Is there some code here that needs to be updated to work w/ 7?
Thanks in advance!!