OK In a previous game on the same AS (2), I made a preloader, the code worked fine, all of the code was isolated on one frame so on another game I copied the frame and pasted into my other game. but the only difference is that one of my games is using flash player 8 (working preloader) and the other is using flash player 6 (not working.) Im using the same code.
here is the frame code (all of it on frame)
var loadingCall:Number = setInterval(preloadSite, 50);
function preloadSite():Void {
var siteLoaded:Number = _root.getBytesLoaded();
var siteTotal:Number = _root.getBytesTotal();
_root.percentage = Math.round(siteLoaded/siteTotal*100);
percentDisplay = _root.percentage+"%";
bytesDisplay.text = "loaded "+siteLoaded+" of "+siteTotal+" bytes";
if (siteLoaded>=siteTotal) {
clearInterval(loadingCall);
}
trace (_root.percentage + " percent")
if (_root.percentage >= 100) {
trace("percentage = 100")
}
}
I get the output error of this when played :
**Error** Scene=Scene 1, layer=preloader, frame=1:Line 4: '{' expected
function preloadSite():Void {
**Error** Scene=Scene 1, layer=preloader, frame=1:Line 17: Unexpected '}' encountered
}
Total ActionScript Errors: 2 Reported Errors: 2
Thanks in advance.