Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Flash - ActionScript

Sound Helo

 
Jump to:  
 
isolatedrummer
PostPosted: Thu Jul 03, 2008 4:30 am    Post subject: Sound Helo
       
I need to make a sound play when i press a key. any help would be nice. Im
using buttons for mouse click to trigger sounds. Making a interactive drum set.

.fla file LINK
 

 
DMennenoh **AdobeCommunit
PostPosted: Thu Jul 03, 2008 8:55 am    Post subject: Re: Sound Helo
       
Press a key or press a button? The Help has a lot of good info, FWIW.

Here's a little sample of playing a library sound if the 'a' key is pressed:

var mySound= new Sound();
var myListener:Object = new Object();

myListener.onKeyDown = function () {
var k = Key.getAscii();
if(k == 65 || k == 97){
mySound.attachSound("soundA");
mySound.start();
}
}

Key.addListener(myListener);


--
Dave -
LINK
Head Developer
LINK
Adobe Community Expert
LINK
 

 
isolatedrummer
PostPosted: Thu Jul 03, 2008 9:44 pm    Post subject: Re: Sound Helo
       
Thanks that help alot. How do you add more sounds to different keys and how do
you make it were you dont have to hold down shift before pressing the key. Also
were in the code tells which key is used.

Thanks
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

kawa ziarnista Och słodka - Dżem gadżety ekskluzywne Moje jedyne marzenie - Anna Jantar stolarka aluminiowa