I’ve recently experienced problems on few AS3 websites. If you embed your SWF file with different WMode, like opaque or transparent in Firefox your Flash won’t load. Actually the Flash loads first frame and then it seems like it stops. Well, it certainly loads but the problem is that loaderInfo Event.COMPLETE and PROGRESS are not fired in Firefox.
That is LAME! Firefox has this “advanced” feature with Flash, it doesn’t load it until that browser tab has focus. Seems like we’re getting problem from there. Anyway, a workaround is to set the Event.ENTER_FRAME function that will check loader
addEventListener(Event.ENTER_FRAME, _listenLoading);// on enter frame to check if it’s loaded
private function _listenLoading(e:Event):void {
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal) {
removeEventListener(Event.ENTER_FRAME, _listenLoading);
_onSiteLoaded();
}
}












7 responses so far ↓
M // June 19, 2009 at 4:11 am |
Thanks! This info was very helpful to me.
Og2t // June 23, 2009 at 4:11 pm |
Thanks! Good to know. There’s another problem with the stage dimensions and FF3. Shortly after the SWF loads, the stage.stageWidth and stage.stageHeight are both equal zero. That could be a problem i.e. when centering the preloader. The fix is simple:
private function checkStageDimensions():void { if (!stageRef.stageWidth || !stageRef.stageHeight) { if (stageCheckCount < 10) setTimeout(checkStageDimensions, 100); stageCheckCount ++; } else { addProgressCheck(); } }craigk // July 21, 2009 at 1:40 pm |
Thanks for that mate, very useful bit of code there.
sherest // July 31, 2009 at 2:06 pm |
thanks! i faced the same problem, but your this useful information helps me out.
thanks a lot.
regards
Sherest
John // September 15, 2009 at 1:05 am |
https://bugs.adobe.com/jira/browse/SDK-12415
Joey van Dijk // September 15, 2009 at 7:42 pm |
This is indeed a bummer, but it has the same issues with IE7/IE8 but then stageWidth=0, so workarounds can be an enterframe like you said or use ADD-events. More info/workarounds at https://bugs.adobe.com/jira/browse/FP-434 and https://bugs.adobe.com/jira/browse/FP-2641.
Really too bad that some of the most basic parts of the Flash Player differ between browsers.
gabe // November 19, 2009 at 3:26 am |
Ran into a similar issue that Og2t mentioned. If my swfs (multiple embedded video players) weren’t immediately visible in Firefox, their stage was 0. Solution was to use the Event.ENTER_FRAME listener to check the values of stage.stageWidth and stage.stageHeight before I ran any resizing functions which depended on accurate stage values.