I am on a deadline for a website I am working on for a local rock band. I have everything done but their mp3 page. I have created a nice looking car radio cd player for the page and it has several buttons for track selection numbered 1-5. When these buttons are hit I would like for them to play a streaming MP3 file. I can not for the life of me get the Mp3 to attach to the button. I have read all the tutorials and still have had no help. Can anyone help???
OK. Here is the code I am working with. Maybe I am very confused cuz I am so tired. If someone can help me out with the rest of the code it would be appreciated. This code is only for the first button.
n (press) {
if (Number(Fmradio) == 0) {
tellTarget ("/meny") {
gotoAndPlay(“Cdinsert”);
menytext = “You Give Love a Bad Name”;
}
} else if (Number(Fmradio) == 1) {
if (Number(radiobutton1) == 0) {
tellTarget ("/meny") {
gotoAndPlay(“start”);
menytext = “The //Rave Channel\\ 12.5 hz. We are playing Rave music none stop and if you like rave music, this is the place for you. Comming up: DJ Hour with Mike and Fritz, so stay tuned for more info and music.”;
}
tellTarget ("/radiobutton1") {
gotoAndStop(“pressed”);
}
tellTarget ("/radiobutton2") {
gotoAndStop(“standard”);
}
tellTarget ("/radiobutton3") {
gotoAndStop(“standard”);
}
tellTarget ("/radiobutton4") {
gotoAndStop(“standard”);
}
tellTarget ("/radiobutton5") {
gotoAndStop(“standard”);
}
} else if (Number(radiobutton1) == 1) {
tellTarget ("/radiobutton1") {
gotoAndStop(“standard”);
}
}
}
}
on (release) {
I am currently online and if anyone can help me I am also on with my msn messenger and will gladly give access to the files that I am referring to. khemmig@msn.com.
Alright, first of all, do you have your mp3’s exported for ActionScript as per “linkage” reached by right-clicking the mp3 and clicking “linkage” then selecting the “Export for ActionScript” checkbox. If you don’t, that’s your problem, so give your mp3 a suitable name and…
//like frame 0
mySound=new Sound();
//now what ever frame your attaching
//the mp3 on or button or whatever
mySound.attachSound("instanceNameYouExportedTheMP3As");
mySound.play();
Alright, that should be pretty self explanatory, but here’s a practical application from one of my .flas:
//_root.exhib is our sound object
_root.exhib = new Sound();
//'ex' is the name I have in the Export for AS thing
_root.exhib.attachSound("ex");
_root.exhib.start(0, 1);
//and now the onSoundComplete thing
//this one was used to loop, but yours would probably
//want to make it stop.
_root.exhib.onSoundComplete = function() {
//Well, it's already loaded, so let's play it again...
//note that starting it on second 20 isn't important
//for you, but it was for the mp3 I was looping.
_root.exhib.start(20, 1);
};
I wish that it had… I am giving up on this cuz I belive that I am in over my head. The design was easy it is actually getting it to work that I can’t do.