Game Twister
Would you like to react to this message? Create an account in a few clicks or log in to continue.


These forums are closed for viewing purposes only. To join the Game Twister community, please register at the new forums here.
 
HomeHome  Latest imagesLatest images  SearchSearch  Log inLog in  RegisterRegister  

 

 AS: Sound

Go down 
AuthorMessage
RT
Admin
Admin
RT


Number of posts : 101
Age : 36
Location : UK
Registration date : 2009-01-07

AS: Sound Empty
PostSubject: AS: Sound   AS: Sound EmptyWed Jan 21, 2009 12:26 am

OUND

To get a sound into Flash: FILE>IMPORT TO LIBRARY>BROWSE>OK

BASIC USE:
Select a layer. Drag the sound from the Library to the Stage.
or
Select a layer. In the right-hand end of the PROPERTIES panel, use the dropdown to select a sound.

EVENT
If you want to loop your sound, you're generally best of choosing EVENT>REPEAT>500 in the other boxes on the PROPERTIES panel. Only one frame of the waveform has to be visible on the timeline for the whole sound to be played. NOTE: if you're planning on making loops, import .wav in preference to .mp3. Clean loops using .mp3 are virtually impossible.

STREAM
If you need the sound to be in sync (eg voiceovers), then choose STREAM. Streaming usually also knocks the .swf size down by a bit, too. If you're using STREAM, then make sure you create enough frame that the whole sound file wave shows on the timeline; any part of the waveform that's not visible won't be played.

EXPORTING:
Biggest problem with new Flash users is unecessarily large filesize due to uncompressed audio. Click FILE>PUBLISH SETTINGS>FLASH tab, and set Audio Stream and Audio Event to 64 kbps or lower (generally 32 kbps is good enough, if not 16). Press CTRL+ENTER to check the quality, and then check the size of the resulting swf - try to reach a good compromise.

ACTIONSCRIPTING:
If you're using a lot of sounds in your movie, you may want a way to manage them. There are two ways to do this (probably more).

No 1 - attachSound
Right-click your sound in the Library and select Linkage.
Tick the 'Export For Actionscript' box - the Export in First Frame box should tick itself
In the 'Identifier' box, type 'sound1'

Select the first frame of your movie, and add these actions:
bgSound = new Sound(this);
bgSound.attachSound("sound1");

When you want the sound to play, use these Actions:
bgSound.start(0, 99);

That's it. The problem now is that it loops itself, so if you want it to stop, you'll have to use stopAllSounds(); or bgSound.stop();

For more information, have a look at these:
Flash>HELP>ACTIONSCRIPT DICTIONARY>SOUND
http://www.flashbax.com/attachsound.htm
http://www.hed.swin.edu.au/design/tutorials/flash/attachsound/index.php

No 2 - Sound MC
(this is the method I generally use, it suits me but may not suit others)
Create a new MC. Give it two keyframes.
On the first frame, add a stop(); action
With the second frame selected, use the Sound dropdown at the right-hand end of the PROPERTIES bar to select a sound.
If you want it to loop:
Set it to EVENT, and select the number of times you wish it to loop. On the second frame, add gotoAndStop(1);
If you want it to stream:
Set it to STREAM, and stretch the MC out to however many frames the waveform takes. After the last waveform frame, add a keyframe (F6), and add gotoAndStop(1);

On the main stage, drag a copy of the MC from the library and give it the instance name 'Sound01'
When you want to play a sound, use:
_root.Sound01.gotoAndPlay(2);

I know I've missed a lot of stuff about sound out in this, but hopefully it will give you a basic idea to be starting from

Links:
http://www.utexas.edu/learn/flash/sound.html
http://www.macromedia.com/support/flash/how/expert/sound/sound05.html
http://www.macromedia.com/support/flash/how/expert/sound/sound07.html
Back to top Go down
 
AS: Sound
Back to top 
Page 1 of 1
 Similar topics
-
» Audio Software: Sound Converters
» Do you make the "uahh" sound?

Permissions in this forum:You cannot reply to topics in this forum
Game Twister :: MultiMedia :: Audio-
Jump to:  
Powered by phpBB © 2001, 2002 phpBB Group
Free forum | ©phpBB | Free forum support | Report an abuse | Forumotion.com