Flash Button w/ Random Sounds
- Started
- Last post
- 7 Responses
- andreuskon
Hey,
I'm currently making a button, and I want it to play random mp3s when the user rolls over the button. Basically, I have 5 different mp3s named 1.mp3, 2.mp3, 3.mp3, etc. When the user rolls over the button, I would like for it to randomly play one of those mp3's... So each time the user rolls over the button, they'll hear 1 of the 5 mp3's.Does anyone know how I might be able to make this happen? Or does anybody have any script that does this sort of thing?
Thanks
- blaw0
create a MC with a stop action on frame one and your mp3 beginning on frame two. make the other four and the place named instances on the stage ("player1", etc.).
name your button playerButton.
add this to the actions layer of the main timeline:
http://rafb.net/paste/results/WI…that should play back when you release the button. for mouseover you'll need to change it to detect a hitTest.
- andreuskon0
Thanks a lot, I'll give that a try.
- blaw0
btw, the double-quotes should be removed from the playerArray in the code i posted. sorry about that.
- andreuskon0
Wow, thanks for the FLA! I really appreciate it!
- blaw0
yes, sir. happy to help.
- jevad0
\m/ BL@W R@WKS \m/
- blaw0
hahaha!
:)