|
-
loadSound/onLoad invoke problems in IE?
Hello,
I'm getting a weird problem that I haven't been able to find a solution for using the search tools or the FAQ topic (or even google).
Internet Explorer doesn't invoke the onLoad command for the sound object when sounds are stored locally, or have already been streamed online and sit in local cache. It's odd because onLoad is invoke in Mozilla in whatever situation just fine, where as IE seems to be bugged.
The code is simple enough, I am using Flash8:
Code:
var backgroundMusic:Sound = new Sound(this);
backgroundMusic.loadSound("music.mp3", false);
backgroundMusic.onLoad = function() {
backgroundMusic.start(0, 999);
};
To be clear, Mozilla will invoke the onLoad and play sfx in any situation. IE would only call onLoad if music.mp3 was actually streamed through the pipe and completed loading. It would otherwise ignore invoke if the file had already been downloaded was stored in cache prior, or that it was called locally on a hardrive.
I'm surprised there isn't documentation online that addresses this- or perhaps I've just missed them.
-
The problem was that IE had loaded the music.mp3 faster than the onLoad was even defined. So it missed the intruction.
The solution is to define the onLoad handle before the loadSound, so:
Code:
var backgroundMusic:Sound = new Sound(this);
backgroundMusic.onLoad = function() {
backgroundMusic.start(0, 999);
}
backgroundMusic.loadSound("music.mp3", false);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|