This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Flash Site Design > August 2005 > Sounds in Flash MX





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Sounds in Flash MX
wiggywoo

2005-08-18, 7:44 pm

I want to add a sound to my Flash website. I have done it through the library > sounds. However I wish to add a song by REM which I have saved on my Pc how do I go about doing this?
David Stiller

2005-08-18, 7:44 pm

wiggywoo,

> I wish to add a song by REM which I have saved on my Pc
> how do I go about doing this?


File > Import > Import to Stage [or] Import to Library.

Be aware that a full song will bulk up your SWF a lot, making it a
potential pain to download for viewing. You may want to consider the Sound
class (see the ActionScript Language Reference [F1 key]) for details. An
instance of the Sound class will allow you to dynamically load MP3s from the
server, where they have the appearance of streaming, because of their
progressive download.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."


Papa Rabbit

2005-08-18, 7:44 pm

http://www.actionscripts.org/tutori...nch/index.shtml
Demon paW

2005-08-19, 7:29 pm

I have developped an easy understanding sound button which loads the music on request and controls the volume email me at webmaster@demonpaw.com if you want to know more about it
wiggywoo

2005-08-22, 7:22 pm

Any chance you could explain to me how to download a song via mp3?
David Stiller

2005-08-22, 7:22 pm

wiggywoo,

> Any chance you could explain to me how to download a
> song via mp3?


I referred you to the Sound class in the ActionScript dictionary. I
really wish you'd give that a shot. ;) The existing code samples provide
everything you need, so I'm just typing what you'll find when you press F1.

Create a variable; let's say "mySong." This variable will hold an
object -- the object will be an instance of the Sound class. The sound
object will contain all the methods (things it can do) and properties
(characteristics it has) of the Sound class, which is true for any instance
of any class.

var mySong:Sound = new Sound();

Now that you've created an instance of the Sound class (aka, you have
instantiated the Sound class), you can use any of the methods found for that
class. Look up "Sound class" in the ActionScript Language Reference and
you'll see a method called Sound.loadSound(), where the description reads,
"Loads an MP3 file into Flash Player." Bingo! Because your Sound class
instance is referenced via your variable name, you can swap out the word
"Sound" for the Sound.loadSound() method with your variable's name ...

mySong.loadSound();

.... and this method accepts two parameters. Check out the documentation to
see what those parameters are. One of them is a string (the name of your
external MP3, and the other is a boolean [true/false] that determines
whether or not the MP3 should "stream" [just keep in mind, it will actually
be a progressive download, not a true stream; but it will feel the same]).


David
stiller (at) quip (dot) net
Tackling the ActionScript Language Reference
http://www.quip.net/tutorials/


amalita

2005-08-30, 7:39 pm

I am trying to use a voiceover in a flash-based cd-rom. i have the mp3 on the
movie clip's timeline, and it is set to streaming, "speech" type, and best
quality. it still sounds tinny and horrible. any ideas? i know if it were a
website i would load it externally, but it is a cd. also, if i loaded it
externally, would the animation still sync up? thanks!

David Stiller

2005-08-31, 7:35 pm

amalita,

> I am trying to use a voiceover in a flash-based cd-rom. i have
> the mp3 on the movie clip's timeline, and it is set to streaming,
> "speech" type, and best quality. it still sounds tinny and horrible.


Set it to one of the MP3 settings. Speech is intended for phone-quality
audio, which is relatively scratchy.

> i know if it were a website i would load it externally, but it is a cd.


You can load external sounds, SWFs, images, and more even from a CD.
(When you're testing any Flash movie, you're testing it from your hard
drive, which is basically a bigger, faster, metal CD.)

> also, if i loaded it externally, would the animation still sync up?


No. For this, you would need to track cue points and compare them
against ActionScript triggers in your timeline.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews