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!

Playing sound dinamically

Status
Not open for further replies.

LastCyborg

Programmer
Feb 7, 2003
256
MX
How can I make that if mouse over an object play a sound imported to the library?

PS. the sound only plays once
 
place this on a movie clip or button

on (rollOver) {
my sound = new sound();
mysound.attachSound(name);//linkage from library
mysound.play();
}
 
i'd like to add that when you import the sound into the library you should mark the option "export for actionscript". otherwise the attachMovie won't work as far as i know. regards

Firegambler
 
just spotted a typo is my post

should be mysound.start() not play()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top