;

PDA

Click to See Complete Forum and Search --> : little jukebox, but actionscript


caramelson
01-27-2004, 12:50 AM
i'm trying to make a selection of 4 different mp3's to play. i've figured out how to do it by having all the sounds stop on rollover, and then playing the individual files, but i want it so that 'on press' the sounds stop, then 'on release', play the file, but i think you need to use actionscript for that.


i'm not sure how to attache the actual file name to these mouse commands.

a preview of the site is here:

http://cec.wustl.edu/~fm2/apa

Can someone help me with the actionscript?

necromanthus
01-27-2004, 03:41 AM
A simple solution:
Create a child-movie with 4 keyframes for each sound:
key 1: nothing
key 2: stop();
key 3: sound
key 4: stop();
So,you have 4 childs called snd1,snd2,snd3 and snd4.
For the first button set this script:

on(press){snd1.gotoAndPlay(1); stopAllSounds();}
on(release){snd1.gotoAndPlay(3);}


That's all.
;)