Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Site Design / August 2005



Tip: Looking for answers? Try searching our database.

Sounds in Flash MX

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wiggywoo - 18 Aug 2005 14:36 GMT
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 - 18 Aug 2005 15:12 GMT
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."
wiggywoo - 22 Aug 2005 14:19 GMT
Any chance you could explain to me how to download a song via mp3?
David Stiller - 22 Aug 2005 15:12 GMT
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 - 30 Aug 2005 21:59 GMT
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 - 31 Aug 2005 13:28 GMT
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."
Papa Rabbit - 18 Aug 2005 15:28 GMT
http://www.actionscripts.org/tutorials/advanced/Flash_MX_Sound_Synch/index.shtml
Demon paW - 19 Aug 2005 23:01 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.