Difference between revisions of "Flash Sound and Volume"
esse quam videri
m (Text replacement - "<csharp>" to "<syntaxhighlight lang="csharp" line="1" >") |
m (Text replacement - "</csharp>" to "</syntaxhighlight>") |
||
Line 36: | Line 36: | ||
mySound.attachSound("StringBender"); //set mySound = to the named instance in the library | mySound.attachSound("StringBender"); //set mySound = to the named instance in the library | ||
mySound.start(0,1); //Play the sound once | mySound.start(0,1); //Play the sound once | ||
− | </ | + | </syntaxhighlight> |
[[Image:FlashVol_1stActionScript.png]] | [[Image:FlashVol_1stActionScript.png]] |
Revision as of 18:29, 25 January 2016
Import Audio file into flash
Make a new flash document
Import Sound file to Library
Select the audio file you want to import
Right click on the file in the library and select Linkage
Name check the boxes and name the Link
Press f9 or Window/Actions to open the actionscript editor in the first frame
type
1 mySound = new Sound(); //New sound object called mySound
2 mySound.attachSound("StringBender"); //set mySound = to the named instance in the library
3 mySound.start(0,1); //Play the sound once
Press ctr/enter to test you movie you should hear the sound we imported play once