Preloader stalling flash movie in IE - actionscript-3

This is only a problem in IE.
the following actionscript is for a simple preloader for a movie i'm working on. It works fine in Firefox but the movie stops on the first frame of the preloader when opened with Internet Explorer. Has anyone had this problem before?
stop();
addEventListener(Event.ENTER_FRAME,checkLoad);
function checkLoad(e:Event):void {
var pcent:Number=this.loaderInfo.bytesLoaded /this.loaderInfo.bytesTotal*100;
bar_mc.scaleX=pcent/100;
loader_txt.text=int(pcent)+"%";
if (pcent==100) {
removeEventListener(Event.ENTER_FRAME,checkLoad);
this.gotoAndPlay(2);
}
}

Watch out for division-by-zero errors!
var pcent:Number=this.loaderInfo.bytesLoaded /this.loaderInfo.bytesTotal*100;
You cannot assume that loaderInfo knows the total number of bytes. Sometimes the sever wont tell the browser how big the file is going to be. In your case the file was probably already cached by Firefox but not IE.
Some people solve this by letting the swf know the file size beforehand, others configure their webserver to send this information.

Related

Flash game loads assets locally but not in browser

I'm creating a flash game that includes two characters. One that is dynamically loaded from a url and the other that's already present on stage. Both characters load up just fine when testing within flash professional but when testing on a browser or opening the swf file itself, neither character loads.
I've already set my playback security settings to "network access only" as suggested in this question: Flash not working in browser but works fine on computer and it still isn't working.
Both images are strips that show the complete character's animation in one picture itself and through the use of masks and code, I'm able to depict each frame of animation.
Here's the file itself if you need to check it out for yourself.
swf file here

Background music with .mp3 file plays late

I use cocos2d-x RC1 and I need a background music to play from an mp3 file. The problem is that it starts to play after 2-3 seconds. I have tried to preload it but here is the problem:
void SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath)
{
}
SimpleAudioEngine::preloadBackgroundMusic is a dummy function and does nothing. Also there is no callback that tells that background music is loaded, so that I could show loading screen untill that moment. Now I don't know how to control the time the music will start to play.
Another was is the .wav file that plays immediately, but .wav file size is 49Mb, which is nonsense. Thus, I stuck. Please help.
I answered your question on the Cocos2d forums about filing a bug for this.
Also, please try and reproduce this in the latest final release: http://cocos2d-x.org/download

Weird flash player glitch (12.0.0.41) in Chrome only

Very recently, after the latest Chrome update which includes Adobe Flash Player Version: 12.0.0.41, a flash app that's been running smoothly for years has begun to "hiccup" during one particular function.
Normal behavior - User logs in to app. App grabs some xml files then draws a calendar onscreen.
Hiccup behavior - User logs in to app. App grabs the xml files but feezes before executing the loadComplete function (according to trace). By freezes, I mean the little load spinner remains onscreen but stops spinning and the calendar doesn't appear onscreen.
Interesting/maddening notes - The mouse cursor responds as if the calendar has been drawn (arrow changes to pointer when mouse passes over an invisible calendar day) but according to my trace log the loadComplete and showCal functions haven't fired.
ALSO, any call to a function unfreezes the glitch (e.g. clicking an invisible calendar day, mousingOver a control button, etc. Anything that triggers a function.) and bam! everything's there and the trace log completes as it should.
As stated, this glitch only occurs in Chrome with the latest Flash Player update (12,0,0,41).
Installing the mozilla version of the flash player debugger (12,0,0,43) and instructing chrome to use it instead fixes the glitch, but using it in chrome opens up a whole new can of worms when it comes to flash player glitches (as is to be expected).
Maybe there's nothing I can do and it's just a fault with the latest Chrome flash player build, OR...
There's something fundamentally wrong with my code and Chrome's latest flash player is the only plugin that glitches on my "wrong" code?
I'll happily include some code snippets if someone is convinced my code is the problem but am leaving them off for now since this question is enormous. (you're a trooper for sticking with it)
I'm hoping someone else has experienced this or can at least explain it/fix it. Thanks in advance.
I'm seeing very similar symptoms on an application I work on Frankenscarf. All workarounds have been ineffective thus far. I can confirm it is specific to 12.0.0.41 Pepper Flash. I think you might need to wait for google to fix the lasted release...
I am also having problems with Flash 12.0.0.41 on YouTube, videos very laggy and dropping frames all the time even making the video stutter on 320p. I have disabled Chromes built in Flash player though Chrome://plugins, installed Chrome 11.7.700.260 and now have the videos running smoothly even at 1440p. Hopefully they will sort out the bugs soon.
I wasn't able to edit my original post...
UPDATE: I managed to get a workaround going. I set up a periodic timer (triggering every 500ms), that calls invalidateDisplayList() in my largest container. It is horrible, but it works....

Flash sound mixer stop all works on swf but not on html server version

This is a very strange bug! im using AS3 and CS5.
So i have a youtube video which plays on one frame, and on every other frame i have:
import flash.media.SoundMixer;
flash.media.SoundMixer.stopAll();
Which stops the video playing when you move to another page, this works fine when running it in flash, but when i publish it to a HTML file and upload it to my server it just never works! the sounds always play!
Is this to do with my publish settings or a strange flash bug?
Thanks,
Adam
When your SWF runs in the browser, it's subject to all the security restrictions that the browser imposes, as well as some additional Flash Player security restrictions. I imagine, that you're running into one of these restrictions.
Instead of trying to stop all sounds from playing, why don't you stop the Youtube player itself? It has an API you can use to do this, using either the pauseVideo() or stopVideo() methods.

Problem with a SWF running in a browser

I made an AS3 animation with Flash. The SWF work perfectly playing directly in the Flash Player.
If I read the SWF file in a browser, interactions like "onRollOver" or "onEnterFrame" doesn't work anymore.
What could be causing this?
Did you properly embed your .SWF? Use SWFObject to embed your .SWF files.
Make sure you have the browser debug player installed if testing, so you can see if there are any errors.
I find the bug ! The first line of my actionscript was :
*stage.displayState=StageDisplayState.FULL_SCREEN;*
With this my swf file doesn't have any response when I roll over it. When I embed the SWF file I use a part of this : . May be such of a conflict...
In the HTML I properly embed my .SWF with SWFObject. Great, thanks for your help !