?
Solved

Animation doesn't play sound on the 1st try

Posted on 2003-03-17
9
Medium Priority
?
168 Views
Last Modified: 2010-04-03
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
Comment
Question by:hobster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
9 Comments
 
LVL 6

Expert Comment

by:henryww
ID: 8154769
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
 
LVL 6

Expert Comment

by:henryww
ID: 8154774
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
 
LVL 2

Author Comment

by:hobster
ID: 8155102
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:henryww
ID: 8161489
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
 
LVL 2

Author Comment

by:hobster
ID: 8162480
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
 
LVL 6

Expert Comment

by:henryww
ID: 8173616
hang on let me try ....
0
 
LVL 6

Accepted Solution

by:
henryww earned 400 total points
ID: 8187701
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
 
LVL 2

Author Comment

by:hobster
ID: 8188085
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
 
LVL 6

Expert Comment

by:henryww
ID: 8188101
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question