hobster
asked on
Animation doesn't play sound on the 1st try
I have a flash animation created using Flash MX at http://www.globalincome2000.com/bp-us.html .
The page loads a large mp3 file and then begins the movie, which is basically a slide show.
The code to load the file (given by henryww) is:
var mySound = new Sound();
mySound.loadSound("../audi o/file.mp3 ", false);
//in another frame I start the audio
mySound.start(0, 0);
When I tested the animation on my local machine, everything worked fine. However, when I uploaded it to the webserver, the sound doesn't always play on the 1st try. I have to keep refreshing the browser to get the sound to play. I have a feeling this might have something to do with the webserver rather than Flash but I just want to throw this out to see if any of you has run into the same problem in the past. Thanks.
The page loads a large mp3 file and then begins the movie, which is basically a slide show.
The code to load the file (given by henryww) is:
var mySound = new Sound();
mySound.loadSound("../audi
//in another frame I start the audio
mySound.start(0, 0);
When I tested the animation on my local machine, everything worked fine. However, when I uploaded it to the webserver, the sound doesn't always play on the 1st try. I have to keep refreshing the browser to get the sound to play. I have a feeling this might have something to do with the webserver rather than Flash but I just want to throw this out to see if any of you has run into the same problem in the past. Thanks.
WOW ... it loaded to 300% .... and more too ...
like i refresh the page i get a different loading % everytime ...
do u mind posting the fla so i can check it for u?
like i refresh the page i get a different loading % everytime ...
do u mind posting the fla so i can check it for u?
ASKER
Ok, I've uploaded the fla to http://www.globalincome2000.com/flash.zip and, yes, it works in your example.
Yeah, I was gonna ask about the weird loading percentage. I looked at the code and couldn't figure out why it was going past 100% :-)
Yeah, I was gonna ask about the weird loading percentage. I looked at the code and couldn't figure out why it was going past 100% :-)
part of the reason why the sound does play is because the preloading is not finished ... the second time or 3rd time etc u can hear the sound cost u have sound already loaded (in cache) then the sound.start(); will work ...
ok ...
i have uploaded the fla, have a look and see if that helps
http://www.smartclever.net/example/flash/loadsound/USBP-Melinda_Stahl.fla
ok ...
i have uploaded the fla, have a look and see if that helps
http://www.smartclever.net/example/flash/loadsound/USBP-Melinda_Stahl.fla
ASKER
Ok, I think it's getting better. However, it doesn't play the audio on the 1st try, even though the audio has been fully loaded. I have to refresh the browser.
In the code, you said the frame rate is too slow. Would it help if I increase it?
In the code, you said the frame rate is too slow. Would it help if I increase it?
hang on let me try ....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your help. I made some changes and the # of 1st time failures is going down. I'll keep monitoring these movies. Did you run into the problem when you looked at the movie?
I've downloaded your changes and will take a look at it.
I've downloaded your changes and will take a look at it.
no i have no problem whatsoever ... it plays everytime ... i have it on my server and emptied my IE cache ...
but i was just thinking ... u can use getTimer to jump from one frame to another, so u let the movie play for say 10sec then jump to the next frame .... therefore u don't have to have a very very long frame for 1frame/sec ...
but i was just thinking ... u can use getTimer to jump from one frame to another, so u let the movie play for say 10sec then jump to the next frame .... therefore u don't have to have a very very long frame for 1frame/sec ...
LOL ...
but it works in my example right?? doesn't it?
let me check it for u