Groups | Blog | Home
all groups > flash (macromedia) > january 2007 >

flash (macromedia) : sound loads/plays too soon


dkmiles
1/13/2007 9:04:34 PM
I created a loader for my swf file, and I'm using the streaming method for the
mp3 track which seems to keep the audio and picture in sync, but the sound
keeps loading and playing when the swf's about 50% loaded. The result is that
the opening frames are dropped. http://www.thing-one.com/07-site

I've been searching the forum and I have not been able to find a solution to
this.

Can anyone help? I'm obviously no Flash expert, so any help would be MOST
appreciated.

Many thanks!
Shan-Dysigns
1/13/2007 9:12:17 PM
cmorrissey
1/13/2007 9:13:45 PM
You should start the audio once the rest of the swf is loaded using the onLoad
or loaded functions to find when your swf graphics are loaded and use the
..play() on your audio. You will also need to turn off the autoPlay on the
audio.
dkmiles
1/13/2007 9:17:50 PM
thanks for the responses... for the quasi-Luddite here, can you provide any more specifics on exactly how to set up the onLoad and the .play() on the audio?

Shan-Dysigns
1/13/2007 9:31:01 PM
[q][i]Originally posted by: [b][b]cmorrissey[/b][/b][/i]
You should start the audio once the rest of the swf is loaded using the onLoad
or loaded functions to find when your swf graphics are loaded and use the
..play() on your audio. You will also need to turn off the autoPlay on the
audio.[/q]

What??

First, there is no .play() for audio. If you setup the audio using new
Sound(), it's called .start().
Second, I don't believe the graphics are loaded externally, so to check if
everything is loaded before you start your audio, you would either check if all
the frames are loaded or use getBytesLoaded().


dkmiles
1/13/2007 9:37:41 PM
I'm sorry, you guys have lost me. Do you know of any tutorials on this subject out there?

Shan-Dysigns
1/13/2007 9:49:38 PM
dkmiles
1/13/2007 10:01:56 PM
cmorrissey
1/13/2007 10:06:53 PM
Shan,

Because I don't know how his clip is set up I gave him some possible functions
he can use.

If i was doing this i would be loading everything from external files and
using the playback component and not the Sound() functions as these functions
severely limit your ability to control the sound in the project, unless you
find that the panning functions are something you really need.

Please help by being constructive.

-----------

DK,

Heres what you will want to do. I believe you are using the loader component
correct ? ok now since you are using this you can use the below action script
with some adjustments to tell your audio to start by using the Sound functions
or the playback component functions since I am not sure what you are using.

If you are not using the loader component to load your pictures please let me
know what you are using so I can get you on the right track, thanks.





var listenerObject:Object = new Object();
listenerObject.complete = function(eventObj:Object){
// ... your .start(); or .play() here
};
loaderInstance.addEventListener("complete", listenerObject);
Shan-Dysigns
1/13/2007 10:36:25 PM
It's just a simple set of tweened animation synced with audio. No need to go so
far as to load anything externally.

I altered your flash file and got rid of needing that external loader flash
file.

http://www.shan-dysigns.com/flashexamples/openSplash.fla
dkmiles
1/13/2007 10:48:50 PM
Shan -- this is so cool of you to fix it for me! I'm only a humble band parent
trying to help out on the weekends, so many thanks! I'll try to decipher what
you did for future reference.

CM -- thank you for the code! I'm still not quite sure how I would implement
it, but I'll spend some time trying to understand. (Although I think this
action script is for rocket scientists)

You guys... and this forum ... are both really terrific.
Greg Ambrose
1/14/2007 5:05:14 PM
Try www,gotoandlearn.com

AddThis Social Bookmark Button