PDA

View Full Version : preloader works with Flash Player 6 not 7


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!!

smerbie
06-04-2004, 11:11 AM
Found a few issues with capitalization. The big fix was switching
"_level1..." references
to
"this..."

-One Happy Camper :D