Hi guys.
I've got a SWF to which I added a Preloader scene. The preloader works fine when I hit Ctrl+Enter in Flash CS4, and select View > Simulate Download.
The preloader displays, and when full, the movie continues as expected.
However, the moment I embed the SWF into some HTML, and load from localhost in any browser, the movie doesn't continue until I right click and select Play.
When I use the Charles Web Debugging Proxy tool and throttle the connection, then again preloading works fine, and the movie proceeds when done?
Any idea what might be going wrong? Here's the source for the preloader:
import flash.events.ProgressEvent;
loaderInfo.addEventListener(ProgressEvent.PROGRESS, update);
function update(e:ProgressEvent):void
{
var percent:Number = Math.floor((e.bytesLoaded * 100) / e.bytesTotal);
if(preloaderClip is MovieClip)
{
preloaderClip.gotoAndStop(percent);
}
if(percent == 100)
{
play();
}
}
// Extra test for IE
var percent:Number =
Math.floor((this.loaderInfo.bytesLoaded * 100) / this.loaderInfo.bytesTotal);
if(percent == 100)
{
nextFrame();
}
stop();