Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pushbutton Component + Sound 1

Status
Not open for further replies.

HomeAway

Programmer
Jun 6, 2003
36
AE
Hi Experts,

I have a few pushbuttons on my site. i want a sound to play on each push button press event.

i converted my push button to a symbol, enter edit mode on my symbol, window -> actions and i added the following

on (press) {
song = new Sound(this);
song.attachSound("pingme");
song.start(0,1);
}

nothing happens. can anyone help ?
 
probably easiest just to give the button an instance name then add code to timeline

my_btn.onPress = function(){
song = new Sound(this);
song.attachSound("pingme");
song.start(0,1);
}
 
billwatson,

HERO !!!! thank you so much for that, i cant believe i didnt try that earlier, you have saved me yet another hour missed at the pub !!

tali ho ole chap.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top