Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

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("../audio/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.
0
hobster
Asked:
hobster
  • 6
  • 3
1 Solution
 
henrywwCommented:
that's me ... now u are holding me responsible!

LOL ...
but it works in my example right?? doesn't it?


let me check it for u
0
 
henrywwCommented:
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?
0
 
hobsterAuthor Commented:
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% :-)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
henrywwCommented:
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
0
 
hobsterAuthor Commented:
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?
0
 
henrywwCommented:
hang on let me try ....
0
 
henrywwCommented:
well ...

i changed it a little bit and tested again on my own server, it seems to work ok ...

try the movie here
http://www.smartclever.net/example/flash/loadsound/swf/USBP-Melinda_Stahl.swf


this is the fla again
http://www.smartclever.net/example/flash/loadsound/USBP-Melinda_Stahl.fla 


i don't why it wouldn't work the 1st time on ur server.....
0
 
hobsterAuthor Commented:
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.
0
 
henrywwCommented:
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 ...

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now