well so here’s the action i put to the button
on (release) {
Sound.stop ([“loop.mp3”])
{
the reference guide calls the part in the brackets the “idName”
well seeming i dun think you can give sounds instance names i really dunno what else to put other than the actual name of the sound file.
If anyone could shed some light on this i’d appreciate it, thx.
system
January 23, 2003, 5:15am
2
try this instead
on (release) {stopAllSounds();
}
Grim
system
January 23, 2003, 5:38am
3
yeh i could do that, but that stops all sounds within the movie up until that frame.
i just wanna be able to start and stop a specific music file.
system
January 23, 2003, 5:59am
4
then do this place your mp3 file in a mc with blank frame and place your mp3 from frame 2, place this code on your stop button
_root.mp3.onRelease = function() {
this.gotoAndStop(1);
}
Grim
system
January 23, 2003, 6:34am
5
aight i’ll try that, but i’m hella tired right now so i think i’ll do it tomorrow
thx for replying =D
system
January 23, 2003, 2:30pm
6
Hi ienjoypie,
If your song is in the library you should be able to just right click on it and then choose properties. Then click on the box to export to 1st frame and give it a linkage name. I believe the linkage name is the “id name” you are referring to.
system
January 24, 2003, 5:44am
7
first off i’d just like to say that Actionscript: The Definitive Guide, Second Edition by Colin Moock is one helluva book.
I got it to work this way (w/ the help of the book of course =D):
on (release) {
mySound = new Sound();
mySound.attachsound(“loop”);
mySound.stop(“loop”);
}
with loop being the linkage name associated with the music file… on the release of the mouse button it stops the song… yay =D
2nd question… a start/stop button… would i go about that with an if statement or… ??
edit: forgot to say thx to andrthad for notifying me bout that linkage name thing… i hadn’t really messed w/ that yet, thanx dood.
thx to grim for replying too =D
system
January 24, 2003, 2:32pm
8
Hi ienjoypie,
Glad you got that to work. The way I made my stop/start button was like so:
create a movie clip.
Make an actions layer, labels layer, StopBtn layer, and PlayBtn layer.
All in frame1: Put the PlayBtn on its layer and then a stop(); command in the actions layer and last a label “playSong” in the label layer.
All in frame5: Put the StopBtn on its layer and then a stop(); command in the actions layer and last a label “stopSong” in the label layer.
Last put your stop and play actions on the appropriate buttons and tell Flash which frame to go to.
Make a DefineSound layer that spans from frame 1 to frame 10.
//Frame 1 of DefineSound layer
mySound = new Sound();
mySound.attachsound("loop");
//stopBtn on frame 5
on (release) {
mySound.stop();
this._parent.gotoAndStop("playSong");
}
//playBtn on frame 1
on (release) {
mySound.start();
this._parent.gotoAndStop("stopSong");
}