1 Button For On/off Music
I am writing a function, although I'm not sure this is the right way, here it goes:
Code:
btn_muziek.onRelease = function(){
if (muziek.start()){
muziek.stop()
} else {
muziek.start();
}}
I understand that this could never work, all it does is play the sound over and over again, while not stoping. What I want is 1 button to start and stop the sound.
I believe that an IF statement requires an comparison. And that that should be in the contsructor, if I'm right about this, than what should I compare it with?
can't wait to show off my website soon! :)
General Flash
Posted on: Thu May 25, 2006 11:39 am
View Complete Forum Thread with Replies
Sponsored Links:
Music Button
Hi, how can i make a flash menu on top, so people can select a ,music (mp3) like: music 1 button, music 2 button etc.
I really would like that.
Gr33yz storm
View Replies !
View Related
Music On/off Button
i tried lookin at the tutorial on here to help me create one of these (music on/off buttons) but it is confusing and i'm still not sure how to make one of these. any help would be great, thanks.
hokie
View Replies !
View Related
Music Button....
Hi. I need help on makin a music button have sound on and off when clicked. For example, orginally it's on, and if you click on it.. it will stop..but if you want it back on again... and click it again... it will turn back on.. and so forth....
What's the code for that?
THANKS
View Replies !
View Related
Music Button...
How do you make a button that let you have music on and off when you keep clicking them? Like normally, it's on... then you click on it ..and it will stop... if you want it back on again.. u click on it...and it will starts from where it left off...and so forth..
anyone know the code for that?
I am also havin problems with scrolling text.. if anyone can im me that would be great
View Replies !
View Related
Music On Off Button
In my portfolio i would like to add a music on/off button. I know i can make a two frame movie clip that will do this, but i dont want to use stopallsounds because then everytime you start the music again it starts the song over. By the way, im using flash five. Im still thinking about using a two frame movie clip, but i want the music to pause instead of stop. I noticed a start and stop actionscript for sound that might be usefull, however, it doesn't work for me. I tried using the help and couldnt figure it out. I was trying this action script out: code: mySound.start(["music"]) At least i think it was something like that. Any help would be appreciated.
View Replies !
View Related
Music On/off Button
hi,
how does one go about creating a music on/off button? (i already know how to make buttons, i just need to know what is the actionscript for music on/off)
any tips will be much appreciated~
View Replies !
View Related
Music In A Button
I would like to know if anyone knows how to put music into a button. Lke if you click the button then it plays the music and if you click it again or click another one it would stop. I would like to do this so that there is a variation in music on my flash games. So there could be 3 types of music and the listener could choose. Any suggestions?
View Replies !
View Related
Music On, Off Button
Hi,
I am working on an intro and I have a soun clip that I want to loop play.
I want to have a little button that when I click the music it will stop, and then click again to start.
Does any body know how this can be done?
Many thanks,
Paul
View Replies !
View Related
I Need Some Help About A On/off Music Button
Hi!
I am in front of a serious problem. I think that it is just a matter of 2-3 lines of action script but I still can't solve my problem. So the situation is the following:
I'm developing a flash site in which I'm using on/off music button which is a movieclip with 2 buttons inside - one for "music off" and te other for "music on". The sound is put in the 1 frame where is put the "music off" button as well. Everything work perfectly to the moment where my movie reaches some frames where the above mentioned "on/off music button" is used again and here is the mess - it starts playing again.
I wish is things to be like that:
Once you've entered the site and everything is loaded the music starts playing and is your decision whether to leave it playing or to stop it(using the "on/off music button" provided. Later when the same button appears to perform actions when pressed as it follows: if the user had left the music playing earlier this time the music to be stopped by pressing the button,and the other state: if the user had stopped the music earlier this time on releasing the button the music to start again. I think that it should be done with "if" statements but I can't do it Give me some help with this please!
Thanks in advance!!!
Lil P
View Replies !
View Related
Music On And Off Button?
I currently have 2 different songs in the website I'm trying to create - one on the intro page and one on the home along with the other pages. Whenever I preview the website I hear both songs playing at the same time.
Another problem is whenever I click the music off button it's not responding. It keeps playing.
Please help me...
Thank You...
View Replies !
View Related
On/ Off Music Button Script
I need a script that will turn music on and off, it must target a sound file with the same .swf file and not effect any other buttons. At present I have two buttons targeting a movie clip with the music in however when I press on other buttons with a rewind script on for navigation purposes it starts playing the music again, any considerations would be very much appreciated.
View Replies !
View Related
Music OnOff Button Help
OK i have a music button that on the start of my site, it plays with the text "music off". Meaning if you click it the music goes off via the telltarget action and then the text "music on" will appear
on (release) {
tellTarget ("bgm") {
play ();
}
}
The bgm is a movie clip on the music button that is actually the text with two layers. The top layer has two frames, each with the music. The first is the mucic in the event state of playing with a fade in and looping over and over, and a stop action in the frame. The second is the music in the event state of stopped with the action stop on the frame. The bottom layer is the text, the first fram "music off", second "music off". OK, so if you turn the music off my clicking the button with the telltarget action on it, the music will turn off. If you have the music off and procede with going throught the timeline in cronological order, everything works fine. BUT, if you go backwards in the timeline ( like by pushing a button to direct you backwards ) THE MUSIC STARTS PLAYING. How do I prevent this? Please help.
View Replies !
View Related
Music Button Onoff
Hi
I am making a MC with a on/off music button, this is what I have
on (release) {
stopAllSounds();
}
What do I need to turn it back on .
ALSO I have some more dumb questions. I am confused about frame actions and object actions, a frame action is a action on a certian frame when the movie gets to it, so how do you assign a object action, I have noticed I must have used it in my music button because their isn't a action symbol anywhere on the button layer but it is turning it off. Could someone explain it to me!
View Replies !
View Related
Pause Button In Music How?
Hey, I have a mediaplayer on one of the pages that I created. The player has three 20 second loops, a play button, a stop button, and a pause button. How do I make the pause button function as a pause button, for as of now the pause button is just acting like a stop button. Here is my code for the pause button.
on (release) {
if (action eq "pause") {
action = "play";
status = "playing tr. " add playtrack;
tellTarget ("tracks") {
gotoAndStop("track" add ../laytrack);
}
play();
} else {
if (action eq "play") {
action = "pause";
status = "paused tr. " add playtrack;
tellTarget ("tracks") {
gotoAndStop("stop");
}
stop();
}
}
}
View Replies !
View Related
Loading SWF Music Button
I have created an .swf file as a button that allows me to turn the music on or off when the page loads. What I am trying to do now is have that swf file in the main swf on the same page. Does this make sense. Right now on my page I have a page sized swf file with the sound swf file just under it with on/off buttons but I don't like how it looks. I would like the on/off swf incorporated into the main movie.
Can anyone pease help??
Thank you.
View Replies !
View Related
Stop Music Button
Okay i got next/prev track buttons working i got play and pause working but when i click Stop button its stops the music. So yeah great however when i press play its plays from the same place i stopped it.I need the stop button to reset the song.
View Replies !
View Related
Button Music Problem
hi! im a newbie in flash and i got a little problem, i want to make a button with music, i want to the music playing when mouse is over and i want the music stop if the mouse is not over, like this one: exemple but the only thing i able to do is to start music when the mouse is over, but the music doesnt stop when the mouse is not over, can someone help me?
thank you.
Dreambill
View Replies !
View Related
Next Scene/ Music Button?
Ok I have designed a little music player for my website. I created it so each scene has a different song playing in the background. I have made it so the user can click on the individual buttons and takes them to whatever song they desire. Only problem is it doesnt; work. I used the following action but I get no results...
on (press) {
gotoAndPlay("MOVIE2");
}
and then for the next button....
on (press) {
gotoAndPlay("MOVIE3");
}
etc...
What am I doing wrong? You can take a look at eh player at http://www.outcastclan.com
It is a pop-up so if oyu have a pop-up blocker you wont be able to view it. Anyhow. Any help you guys could give would be greatly appreciated
View Replies !
View Related
Music Button And Mousescroller
I have a quistion.
have can it be that when you have a music button on level 1 and you have made a home made mouse scroller, that when you drag it over the musik button the mouse scroller is undernith the button.
I tryed to make my mouse scroller on level 2 but it will not let me.
So i hade to delete my home made mouse scroller, and now it is working.
I dont understand??
View Replies !
View Related
Error/button Music
Hi, Im making a flash picture...sort of like a banner for a website. Well for my banner I was planning on having it for when ever your mouse hovers ontop of it, music will start to play...so anyways I figured out how to get music to play but I need to make it so it only starts when the mouse rolls over it and to stop when mouse rolls off.
code:
on(rollOver){
dearly.start(0,99);
}
on(rollOut){
dearly.stop();
}
Is what I have so far and I get an error.
code:
**Error** Scene=Scene 1, layer=BG, frame=1:Line 2: Mouse events are permitted only for button instances
on(rollOver){
**Error** Scene=Scene 1, layer=BG, frame=1:Line 5: Mouse events are permitted only for button instances
on(rollOut){
Total ActionScript Errors: 2 Reported Errors: 2
Please help
View Replies !
View Related
[F8] Crazy Music Button
I have a MC "button" that loads an external mp3
the external mp3 is called "block_party.mp3"
the button instance is "song1".
can any one tell me why this doesn't work. My code is as follows:
__root.song1.onRelease = function() {
this.createEmptyMovieClip ("song1", this.getNextHighestDepth());
var song1:Sound = new Sound (mcSong1);
song1.loadSound("block_party.mp3", flase);
song1.onLoad = function (bSuccess:Boolean):Void {
if(bSuccess) {
this.start();
};
};
var nInterval:Number = setInterval (checkProgress, 500);
function checkProgress():void {
}
}
Thanks.
RSB
View Replies !
View Related
Music On Button Click
I am trying the following but am stuck, hope someone could guide me.
On clicking the button a sound clip of 2 seconds needs to play and then load a different html page.
I have tried various combinations, though the music plays, the link does not work.
View Replies !
View Related
Crazy Music Button
I have a MC "button" that loads an external mp3
the external mp3 is called "block_party.mp3"
the button instance is "song1".
can any one tell me why this doesn't work. My code is as follows:
__root.song1.onRelease = function() {
this.createEmptyMovieClip ("song1", this.getNextHighestDepth());
var song1:Sound = new Sound (mcSong1);
song1.loadSound("block_party.mp3", flase);
song1.onLoad = function (bSuccess:Boolean):Void {
if(bSuccess) {
this.start();
};
};
var nInterval:Number = setInterval (checkProgress, 500);
function checkProgress():void {
}
}
Thanks.
RSB
View Replies !
View Related
Music On/off Toggle Button
This should be simple - but its driving me mad!
I am trying to script a music on/off button to control the music playing on a large movie - various different pieces all loaded dynamically with a fadein function.
After the first piece starts in the intro there is a music off button with this script:
Code:
on (release) {
if (done_it != 1) {
back.stop();
done_it = 1
}
}
which basically sets the flag done_it to 1 when the music is off. All other pieces loading check against this flag and will only fadein if done_it != 1.
So far so good.
I also want to add an optional music/on off button which will check against this flag and fadein the music if there is none already playing, or stop all sounds if something is playing.
Thus I have another button later in the movie with this script - and its this that is giving me problems:
Code:
on (release)
{
if (done_it == 1) {
fadeIn01 = 1
if (fadeIn01 == 1) {
// fadeIn01 can be set to 1 when a button is
// pressed, when a frame is reached or many other ways.
_root.beat.setVolume(beatVolume);
// Sets the volume for the sound object "beat"
// to the variable "beatVolume" every time the
// frame is entered during the movie clip loop.
beatVolume = beatVolume+2;
// Increments the variable "beatVolume" by 5.
// Increase or decrease this to change the speed of
// the fade from 0 to 100.
if (beatVolume>25) {
fadeIn01 = 0;
// This stops the "beatVolume" from incrementing
// by making the if-statement false once the volume
// reaches 25%.
}
//Closes 2nd fadeIn if-statement}
}done_it = 0
//Closes 1st fadeIn if-statement}
}
else {if (done_it != 1) {
stopAllSounds();
done_it = 1
}
}
}
//Closes function
This works partially in that it will switch off music already playing or fadein music if none is going. However, I must have goofed somewhere with the music off part as once the music is switched off with this button, it won't then come back on again, yet conversely it works - if the music was already off via the first button in the intro, you can switch it on with this button and a second press will stop it again.
I am guessing that the flag done_it = 1 isnt resetting after the stopAllSounds
but I can't see why or what else I might have done.
Can anyone help?? Please!! Look for the obvious- I'm new at this and there are already many hours work and working thru tutorials to get this far!!!
View Replies !
View Related
One Button To Turn Music ON/OFF
I've tried for hours n hours.. I still can't figure this out:-
How can I use ONE button to toggle the sound ON or OFF... if the sound is off the button will turn the sound on and if the sound is on and playing, the button will turn the sound off. Pretty straight forward but I am stumped
TIA
View Replies !
View Related
On/off Button For Music In All Scenes
I have this animation where I want there to be an onn/off button to be able to turn the backgound music off whenever the user is sick of it. My problem is each scene seems to work independentaly form each other and the music overlaps (starting again when you enter the new scene) and I am kind of new to flash.
PLEASE HELP ME!!!
View Replies !
View Related
Mx2004 Music On/off Button
sorry i think i posted this in the wrong forum before :oops:
anyway, i have made a music on/off button for a site in flash mx 2004 pro, however every time you jump to a new marker/page, the music starts again, resulting in the same piece of music playing several times over the top of each other. how do i remedy this so the off button keeps the music on/off throughout the site?
thanks.
View Replies !
View Related
Using One Button To Turn Music On/off
Is it possible to have one button the toggle my 'my_sound.setVolume();' between 0 and 100.
I'm having a hard time getting the as correct, but here is my idea:
ActionScript Code:
music_but = "on"if music_but == "on" {music_but.onPress = function(){ my_sound.setVolume(0);music_but = "off";}else if (music_but == "off"){music_but.onPress = function(){ my_sound.setVolume(100);music_but = "on";};
Can anyone help me format this correctly? Thanks!
View Replies !
View Related
On/off Button For Music In All Scenes
I have this animation where I want there to be an onn/off button to be able to turn the backgound music off whenever the user is sick of it. My problem is each scene seems to work independentaly form each other and the music overlaps (starting again when you enter the new scene) and I am kind of new to flash.
PLEASE HELP ME!!!
View Replies !
View Related
Mx2004 Music On/off Button
sorry i think i posted this in the wrong forum before :oops:
anyway, i have made a music on/off button for a site in flash mx 2004 pro, however every time you jump to a new marker/page, the music starts again, resulting in the same piece of music playing several times over the top of each other. how do i remedy this so the off button keeps the music on/off throughout the site?
thanks.
View Replies !
View Related
Problem With Music On/off Button
Hi,
I created a movie with background loops/sound.
I have an on/off button for it.
In my scene, on the last frame I inserted this action script gotoAndPlay(115);
My problem is with the sound button. The button works fine when I press stop. But when it goes back to the 115 frame the music starts playing again.
How do I stop the music on the button for good?
Thanks for your help!!
Liz
View Replies !
View Related
Music On/off Button That Stays Off
Hi,
I've got a question that I thought would be easy to achieve but I can't manage to do it.
I have a flash site that has five different 'sections' defined by labels in the timeline ('about', 'contact', 'products' etc)
Every time you go to a new section I would like a 5 sec bit of music play. So far this is simple enough as I can just bring the music into the first frame of each section.
However I also want the option that if you don't want to hear the music you can hit an 'off' button. Then if you move to a different section the music will stay off unless you decide to hit an 'on' button.
I could see this working with an if statement however I'm not exactly sure how to proceed so any help would be appreciated,
thanks,
Tim
View Replies !
View Related
How Does One Asign Music Loops To A Button
How can i asign several music loops to a button and turn them on or off whenever during the flash movie. For example
if i have three music loops which i wish to put up on my site, and i have one button to turn on or off the music loop and next it i have, 1 2 3 which are used to change between the three music loops.
Thank you very much
Salman...
View Replies !
View Related
Looping Music And Starting With Button
Hi. I'm kinda new with Flash MX. I was wondering how to make music loop seamlessly. I also want to know how to start a movie out with a button. I know how to make the pre-loading movie, but after the movie is done loading, i want to be able to have a button that says play. After you click the button, it would go to the next frame and play the movie. I've tried it several different ways and I can not figure it out. Thanks for all the help.
View Replies !
View Related
|