FMX Help Needed ActionScipt For Multiple Sound Toggle
Hello All,I have been trying to make a sound control panel in an SWF movie that toggles through about 4 different music tracks. I have not been able to get the if/else statements to work for the button. Could someone tell me what is wrong with this script(below)? 1-4 are the tracks in my library and I have made the export linkage for all them. Any help would be appreciated! Frame Script_root.music=true;_root.music2=true;techno=new Sound();techno.attachSound("1");techno.start();techno1=new Sound();techno1.attachSound("2"); techno2=new Sound();techno2.attachSound("3"); techno3=new Sound();techno3.attachSound("4") Object(button) Script on(release) {if(_root.music == true){techno.stop();techno1.start();_root.music=false; } else {techno1.stop();techno2.start();_root.music=true; }if(_root.music == true){techno.stop();techno1.start();_root.music=false; } else {techno1.stop();techno2.start();_root.music=true; }}
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 04-12-2004, 03:44 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
FMX Help Needed ActionScipt For Multiple Sound Toggle
Hello All,
I have been trying to make a sound control panel in an SWF movie that toggles through about 4 different music tracks. I have not been able to get the if/else statements to work for the button. Could someone tell me what is wrong with this script(below)? 1-4 are the tracks in my library and I have made the export linkage for all them. Any help would be appreciated!
Frame Script
_root.music=true;
_root.music2=true;
techno=new Sound();
techno.attachSound("1");
techno.start();
techno1=new Sound();
techno1.attachSound("2");
techno2=new Sound();
techno2.attachSound("3");
techno3=new Sound();
techno3.attachSound("4")
Object(button) Script
on(release) {
if(_root.music == true){
techno.stop();
techno1.start();
_root.music=false;
} else {
techno1.stop();
techno2.start();
_root.music=true;
}
if(_root.music == true){
techno.stop();
techno1.start();
_root.music=false;
} else {
techno1.stop();
techno2.start();
_root.music=true;
}
}
Urgent Help Needed/toggle Sound Mute With Rollover Button AS3
I am currently working on an animation with a band soundtrack. The animation loads 5 sound objects, 1 being the full soundtrack playing and 4 being the singled out instruments (muted) of the band. All 5 sounds are synchronized. There are 4 buttons representing each of the instruments and I want to mute the main sound and un-mute the instrument the button represents by rolling over and reverse this on rolling out.
This is the script i used to make the sounds play:
import flash.media.SoundChannel;
var sc:SoundChannel=new SoundChannel();
sc=new soundtrack().play();
sc.soundTransform=new SoundTransform(1);
sc=new trumpet().play();
sc.soundTransform=new SoundTransform(0);
sc=new guitar().play();
sc.soundTransform=new SoundTransform(0);
sc=new drums().play();
sc.soundTransform=new SoundTransform(0);
sc=new contrabass().play();
sc.soundTransform=new SoundTransform(0);
Anyone can help with the button scripts please?
Thomas
Sound Toggle For Multiple Scene/sounds?
my site is structured such that clicking on a new section calls on a different sound via a/s (sounds have been linked as objects).
i cant come up with a conceptual framework for making a mute button that would (i) stop the current sound being played, (ii) stop any subsequent sounds being fired because a new section is clicked on, *and* (iii) continue the sound assigned to the current section once it's un-muted.
granted that my a/s skills frankly suck, this has been driving me up the wall and all the tutorials / fla's ive found only deal with one sound.
at worst, i can do a wanna-be sound toggle via stopAllSounds(); but that doesn't take care of (ii) and (iii) above.
if anyone can give me a general conceptual framework (a separate sound mc?), i'd greatly appreciate it. thanks in advance.
yjk
Actionscipt Animation Help Needed
Ok here is the script:
onClipEvent (enterFrame) {
_root.check = this._x;
// This is for the first time it starts
if (_root.Bar01x == "n") {
_root.Bar01x = random ( 377 )-188;
if (this._x > _root.Bar01x) {
setProperty (this, _x, this._x - _root.rate);
} else {
setProperty (this, _x, this._x + _root.rate);
}
}
// Set Variable to see which way the bar is moving
if (this._x > _root.Bar01x) {
whichWay = RtoL;
} else if (this._x < _root.Bar01x) {
whichWay = LtoR;
} else if (this._x == _root.Bar01x) {
whichWay = change;
}
// This is to check to see if it will pass its mark
if (whichWay == LtoR) {
if (this._x + _root.rate < _root.Bar01x) {
setProperty (this, _x, this._x + _root.rate);
} else if (this._x + _root.rate >= _root.Bar01x) {
_root.Bar01x = random ( 377 )-188;
if (this._x > _root.Bar01x) {
setProperty (this, _x, this._x - _root.rate);
} else {
setProperty (this, _x, this._x + _root.rate);
}
}
}
if (whichWay == RtoL) {
if (this._x - _root.rate > _root.Bar01x) {
setProperty (this, _x, this._x - _root.rate);
} else if (this._x - _root.rate <= _root.Bar01x) {
_root.Bar01x = random ( 377 )-188;
if (this._x > _root.Bar01x) {
setProperty (this, _x, this._x - _root.rate);
} else {
setProperty (this, _x, this._x + _root.rate);
}
}
}
if (whichWay == change) {
_root.Bar01x = random ( 377 )-188;
if (this._x > _root.Bar01x) {
setProperty (this, _x, this._x - _root.rate);
whichWay = RtoL;
} else {
setProperty (this, _x, this._x + _root.rate);
whichWay = LtoR;
}
}
}
Now what should happen is that _root.Bar01x will select a random number. Then the movie clip will travel to that spot and then pick another random number for _root.Bar01x and loop through it. The Problem is that the variable _root.Bar01x keeps changing before the movie clips x value reaches that spot. Please help me if you can.
Actionscipt Backend Technology Script Needed
i need a script in psp or javascript or asp or whatever to store the values of an array from an swf file located on my server into a txt file located on my server too. Later i want this value to be changeable from the same or different swf file on just a buttons click.
Please reply.
thnx
Actionscipt Help For Multiple Button Commands
Hi
I hope someone can help me with a problem I am having with a site I am trying to do for a friend in Flash MX 2005.
Its for a gallery. I have a button that has to open and shut a door while the next gallery picture loads. The door is a movieclip with sound and I have that working perfectly.
Where I get stuck is i told the button "on press" to play the door movie clip which is fine. And also I tell the button "on release" to the nextframe to show the next gallery picture (on main scene timeline not movie clip) but the gallery picture is coming up before the door movieclip open and shuts. I would like to know the actionscipt I need to insert to make it that the nextframe doesn't come up before the door has shut. Is there a way to delay the nextframe command?
Thank you for any advice you can give.
Placing Multiple Movie With Actionscipt?
I not that good with AS, but I know a few basics. I have a question for placing multiple movies with AS
Ik got a movie called "square". I can place this movie on my scene and attach it to a movie with the instance name "holder". Now i want to place this square a few times on the scene with a space of 10 pixels between them. This is the code I got so far.
Code:
var total:Number = 6;
var spacer:Number = 10;
for(var i:Number = 0; i < total; i++) {
mcSquare = holder.attachMovie("square", "mcSquare", this.getNextHighestDepth());
mcSquare._x += mcSquare._width + spacer;
}
So i basiclly want to place 6 squares next to eachother, width a spacing of 10 pix between them.
Desperate Toggle Help Needed
Hello all....I am in a situation where I need this done by Friday and I am pretty stuck. I need the menus on my site to go up on one click no matter what the situation. Right now, you need to click on a photographer twice to make the menu go up *if* another menu is up above it. Can someone help??? The site is still developing: www.wincreps.com
ewwinc.asp
Here is my current actionscript courtesy of Stu's help:
// Easing in/out function
MovieClip.prototype.Easing = function() {
this._y += (this.endy-this._y)*0.3;
};
// Total menus
totalmenus = 25;
// set this to the number of menus
_global.down = true;
// new variable to toggle the button
// Apply this code to all our menus
for (n=1; n<=totalmenus; n++) {
_root["menu"+n].endy = _root["menu"+n]._y;
_root["menu"+n].downy = _root["menu"+n]._y;
_root["menu"+n].upy = _root["menu"+n]._y-105;
_root["menu"+n].upbut.n = n;
// I edited this part....
_root["menu"+n].upbut.onRelease = function() {
if (down == true) {
for (i=1; i<=this.n; i++) {
_root["menu"+i].endy = _root["menu"+i].upy;
}
down = false;
} else {
for (i=1; i<=this.n; i++) {
_root["menu"+i].endy = _root["menu"+i].downy;
}
down = true;
}
};
_root["menu"+n].celebLarry.onRelease = function() {
_root.gotoAndPlay("LCeleb");
};
_root["menu"+n].LMusic.onRelease = function() {
_root.gotoAndPlay("LMusic");
};
_root["menu"+n].LCorporate.onRelease = function() {
_root.gotoAndPlay("LCorporate");
};
_root["menu"+n].LPortrait.onRelease = function() {
_root.gotoAndPlay("LPortrait");
};
_root["menu"+n].BJCorporate.onRelease = function() {
_root.gotoAndPlay("BJCorporate");
};
_root["menu"+n].BJLife.onRelease = function() {
_root.gotoAndPlay("BJLife");
};
_root["menu"+n].BJTravel.onRelease = function() {
_root.gotoAndPlay("BJTravel");
};
_root["menu"+n].BJPortrait.onRelease = function() {
_root.gotoAndPlay("BJPortrait");
};
_root["menu"+n].BJChild.onRelease = function() {
_root.gotoAndPlay("BJChild");
};
_root["menu"+n].AnjaFashion.onRelease = function() {
_root.gotoAndPlay("AnjaFashion");
};
_root["menu"+n].AnjaStill.onRelease = function() {
_root.gotoAndPlay("AnjaStill");
};
_root["menu"+n].AnjaFashion.onRelease = function() {
_root.gotoAndPlay("AnjaFashion");
};
_root["menu"+n].HopeBeauty.onRelease = function() {
_root.gotoAndPlay("HopeBeauty");
};
_root["menu"+n].HopeFashion.onRelease = function() {
_root.gotoAndPlay("HopeFashion");
};
_root["menu"+n].MazurCelebrity.onRelease = function() {
_root.gotoAndPlay("MazurCelebrity");
};
_root["menu"+n].MazurPortrait.onRelease = function() {
_root.gotoAndPlay("MazurPortrait");
};
_root["menu"+n].portraitMack.onRelease = function() {
_root.gotoAndPlay("portraitMack");
};
_root["menu"+n].portraitMazur.onRelease = function() {
_root.gotoAndPlay("portraitMazur");
};
_root["menu"+n].celebrityMack.onRelease = function() {
_root.gotoAndPlay("celebrityMack");
};
_root["menu"+n].sportsMack.onRelease = function() {
_root.gotoAndPlay("sportsMack");
};
_root["menu"+n].MackSports.onRelease = function() {
_root.gotoAndPlay("MackSports");
};
_root["menu"+n].MackCelebrity.onRelease = function() {
_root.gotoAndPlay("MackCelebrity");
};
_root["menu"+n].MackPortrait.onRelease = function() {
_root.gotoAndPlay("MackPortrait");
};
_root["menu"+n].HopeMusic.onRelease = function() {
_root.gotoAndPlay("HopeMusic");
};
_root["menu"+n].FrancoFashion.onRelease = function() {
_root.gotoAndPlay("FrancoFashion");
};
_root["menu"+n].FrancoBeauty.onRelease = function() {
_root.gotoAndPlay("FrancoBeauty");
};
_root["menu"+n].FrancoTravel.onRelease = function() {
_root.gotoAndPlay("FrancoTravel");
};
_root["menu"+n].LisaChild.onRelease = function() {
_root.gotoAndPlay("LisaChild");
};
_root["menu"+n].LisaTravel.onRelease = function() {
_root.gotoAndPlay("LisaTravel");
};
_root["menu"+n].ReedFashion.onRelease = function() {
_root.gotoAndPlay("ReedFashion");
};
_root["menu"+n].MattBeauty.onRelease = function() {
_root.gotoAndPlay("MattBeauty");
};
_root["menu"+n].MattPortrait.onRelease = function() {
_root.gotoAndPlay("MattPortrait");
};
_root["menu"+n].MattMusic.onRelease = function() {
_root.gotoAndPlay("MattMusic");
};
_root["menu"+n].MortPort.onRelease = function() {
_root.gotoAndPlay("MortPortrait");
};
_root["menu"+n].MortStill.onRelease = function() {
_root.gotoAndPlay("MortStill");
};
_root["menu"+n].MortConcept.onRelease = function() {
_root.gotoAndPlay("MortConcept");
};
_root["menu"+n].SteveFashion.onRelease = function() {
_root.gotoAndPlay("SteveFashion");
};
_root["menu"+n].StevePortrait.onRelease = function() {
_root.gotoAndPlay("StevePortrait");
};
_root["menu"+n].SteveBeauty.onRelease = function() {
_root.gotoAndPlay("SteveBeauty");
};
_root["menu"+n].SteveTravel.onRelease = function() {
_root.gotoAndPlay("SteveTravel");
};
_root["menu"+n].JeffCeleb.onRelease = function() {
_root.gotoAndPlay("JeffCeleb");
};
_root["menu"+n].JeffPort.onRelease = function() {
_root.gotoAndPlay("JeffPort");
};
_root["menu"+n].celebBusacca.onRelease = function() {
_root.gotoAndPlay("celebBusacca");
};
_root["menu"+n].portraitBusacca.onRelease = function() {
_root.gotoAndPlay("portraitBusacca");
};
_root["menu"+n].musicBusacca.onRelease = function() {
_root.gotoAndPlay("musicBusacca");
};
_root["menu"+n].corporateBusacca.onRelease = function() {
_root.gotoAndPlay("corporateBusacca");
};
_root["menu"+n].lifestyleFormento.onRelease = function() {
_root.gotoAndPlay("lifestyleFormento");
};
_root["menu"+n].lifestyleVacc.onRelease = function() {
_root.gotoAndPlay("lifestyleVacc");
};
_root["menu"+n].travelFormento.onRelease = function() {
_root.gotoAndPlay("travelFormento");
};
_root["menu"+n].portraitFormento.onRelease = function() {
_root.gotoAndPlay("portraitFormento");
};
_root["menu"+n].childrenFormento.onRelease = function() {
_root.gotoAndPlay("childrenFormento");
};
_root["menu"+n].corporateFormento.onRelease = function() {
_root.gotoAndPlay("corporateFormento");
};
_root["menu"+n].fashionHinrichsen.onRelease = function() {
_root.gotoAndPlay("fashionHinrichsen");
};
_root["menu"+n].stilllifeHinrichsen.onRelease = function() {
_root.gotoAndPlay("stilllifeHinrichsen");
};
_root["menu"+n].beautyHope.onRelease = function() {
_root.gotoAndPlay("beautyHope");
};
_root["menu"+n].fashionHope.onRelease = function() {
_root.gotoAndPlay("fashionHope");
};
_root["menu"+n].musicHope.onRelease = function() {
_root.gotoAndPlay("musicHope");
};
_root["menu"+n].fashionLacosta.onRelease = function() {
_root.gotoAndPlay("fashionLacosta");
};
_root.menu12.beautyLacosta.onRelease = function() {
_root.gotoAndPlay("beautyLacosta");
};
_root["menu"+n].travelLacosta.onRelease = function() {
_root.gotoAndPlay("travelLacosta");
};
_root["menu"+n].childrenMeloni.onRelease = function() {
_root.gotoAndPlay("childrenMeloni");
};
_root["menu"+n].travelMeloni.onRelease = function() {
_root.gotoAndPlay("travelMeloni");
};
_root["menu"+n].fashionReed.onRelease = function() {
_root.gotoAndPlay("fashionReed");
};
_root["menu"+n].beautyRodgers.onRelease = function() {
_root.gotoAndPlay("beautyRodgers");
};
_root["menu"+n].portraitRodgers.onRelease = function() {
_root.gotoAndPlay("portraitRodgers");
};
_root["menu"+n].musicRodgers.onRelease = function() {
_root.gotoAndPlay("musicRodgers");
};
_root["menu"+n].portraitSmidt.onRelease = function() {
_root.gotoAndPlay("portraitSmidt");
};
_root["menu"+n].stilllifeSmidt.onRelease = function() {
_root.gotoAndPlay("stilllifeSmidt");
};
_root["menu"+n].conceptualSmidt.onRelease = function() {
_root.gotoAndPlay("conceptualSmidt");
};
_root["menu"+n].fashionVacc.onRelease = function() {
_root.gotoAndPlay("fashionVacc");
};
_root["menu"+n].portraitVacc.onRelease = function() {
_root.gotoAndPlay("portraitVacc");
};
_root["menu"+n].beautyVacc.onRelease = function() {
_root.gotoAndPlay("beautyVacc");
};
_root["menu"+n].travelVacc.onRelease = function() {
_root.gotoAndPlay("travelVacc");
};
_root["menu"+n].celebVespa.onRelease = function() {
_root.gotoAndPlay("celebVespa");
};
_root["menu"+n].portraitVespa.onRelease = function() {
_root.gotoAndPlay("portraitVespa");
};
_root["menu"+n].onEnterFrame = function() {
this.Easing();
};
}
stop();
Multiple Toggle Button(s)
Hello, I am trying to create a effecient way to create a toggle for multiple buttons and wondering if anyone out there has an effective way to do it. I have about 12 buttons (movieClips) and each has 2 frames in it. "On" and "Off" .. I have it set up right now with a bunch of "_global's" and if Statements in several "onPress" functions .. which works fine, but I am trying to condense all of the code down.
Is there a way I can roll the toggle state and the onPress for each button into just 1 or 2 functions?
Thanks!!
Toggle Alpha Of Multiple Mc
hello,
I am building out a nav bar that contains 6 items where I would like:
- when you first load the page, all button alphas are at 100%
- when you mouseover(and eventually select) a button, that button stays at 100% and fades the other button's alpha's down to 60%
- when you mouseout all buttons (unless one is selected) return to 100%
I am stumped on how this should occur.
can anyone assist?
[F8] Help Using Actionscript To Toggle Between Multiple Items
Hi all,
I used a combination of Movie Clip Event Handlers and Methods to create interactivity in this card. The displayed object is supposed to change when the button is clicked. So far it works if you click each option once. But, if you want to select an option you had clicked on previously, it doesn't work. For example:
1. The buttons that are supposed to display each shape are on the bottom of the screen. Click on the button of the 1st snowman shape, then the 2nd snowman shape, then the 3rd.. You'll notice that the shapes change accordingly.
2. But, if after you do this, you click on either the 1st or 2nd shape again, the button doesn't work anymore.
Can anyone help me figure out what I'm doing wrong?
Thanks!
Independant Toggle Of Multiple Sounds?
Hi there,
I was wandering if you could help me with a problem i have got. I have tried many tutorials and a few forums but i just cant get it.
I can stop and start a music sample by pressing a keyboard key. once to start, then a second time to stop.
However, when i i try to do this with more than one keyboard key it messses up. I can get All of the seperate music samples assigned to personalised keys playing simoultaniously but when i push one of the keys to stop one of the sounds, all of the samples stop.
I want to be able to control each music sample seperatley from specific keys.
Below is the code i am currently using. (is it right??). any help would be much appreciated please.
loop = new Sound();
loop.attachSound("drums");
var keyToListenFor:Number = 32; // space bar
var keyListener:Object = new Object();
keyListener.onKeyDown = function():Void
{
trace( "Key = " + Key.getCode() );
if( Key.getCode() == keyToListenFor )
{
if( isPlaying == true )
{
loop.stop();
isPlaying = false;
}
else
{
loop.start();
isPlaying = true;
}
}
};
Key.addListener( keyListener );
THANKS
john
Sound Toggle Between On And Off
hi
I have created a MC and an invisible button
1.In MC I placed button.
2. frame 1 _root.sound=1;
3. In MC
OnClipEvent(EnterFrame){
if (_root.sound==0){
stopAllSounds()
}
else
_root.a.play();//where a is MC
}
4.In Button
on (release) {
if (_root.sound==0){
_root.sound=1;
}
else if (_root.sound==1){
_root.sound=0;
}
}
>> Sound On/off Toggle
i'm trying to make a toggle switch (not volume control) for the sound loop in my movie...
here's what i've got so far:
- - - - - - - - - - - - - - - - - - - - - - - - -
on (release) {
if (soundOn.music<1) {
_root.flick.gotoAndPlay("flickers");
soundOn.music = soundOn.music+1;
soundOn.soundback.gotoAndStop(1);
stopAllSounds ();
soundOn.gotoAndPlay(2);
} else {
_root.flick.gotoAndPlay("flickers");
soundOn.soundBack.gotoAndPlay("loop");
}
}
- - - - - - - - - - - - - - - - - - - - - - - - -
this will turn the sound off okay... and will toggle it back on again when pressed... but i cannot get the sound to turn off again after that. it just drops the sound loop over and over again (on top of itself) creating a virtual trainwreck of a drumloop.
any suggestions?
thanks...
.andy
Sound Toggle
I am having a really hard time finding out how to create a sound toggle button in Flash 5. I created one that was a two frame movie clip. It works well until I click a button I have given a 'goToandPlay" previous frame action (my site is a small personal portfolio that works on a frame by frame basis instead of tell target). Can someone please help me? Thank you in advance.
Dave
Sound Toggle
I have a Flash movie that begins with music playing and looping every 10 -15 seconds on the main timeline. I want to create a button that will turn off/on the music on the main timeline (scene 1) without affecting the other scenes. The tricky part is that the music is on its own layer on the main timeline, and is not contained inside the button I created.
So far, I've been able to create the button that turns off the music, but when I click the button again, I cannot figure out how to get the music to play again.
Please help...
T.
Sound Toggle
For the love of God, somebody please help me with this! I was advised from an earlier post to do a set volume action to create my sound toggle. In other words, pressing the button once will play the clip at full volume, pressing it again will play the clip at no volume. How exactly do I do that? I'm a newbie...
Thank you and Regards,
rheingold
Toggle Sound On And Off
Hello:
I would like to create a button that would toggle sound on and off, but when I press the button the sound would fade out and press it again would fade in.
Thanks in advance for anyone who replies.
Sound Toggle
I need help. How do you make an on and off switch for the sound in your movie? I know how to make the buttons but I don't know the actionscript. Also where would you put the sound? Would the sound go in the same movie clip as the on and off switch or a separate scene or a whole seperate file altogether? Thanks
Toggle Sound
Hi,
I have 2 buttons that stop or start a sound,
On release mysound.start(0,1)
and on the other button
On release mysound.stop()
Works fine, however I only want 1 button that toggles the sound on and off,
I cant seem to find a simple piece of code for this,
Cheers
Sound Efx/ Toggle Off
Hi,
Is there a way I can have an on/off switch for sound efx? I have created buttons that turn off music tracks and such, but I would need code to tell the sound effect that I have in the down state for each of my buttons to be silent upon hitting the "sound off" button. Is there a way to do this?
Thanks in advance,
Mike
Sound Toggle
I have background audio loaded as a sound object, referencing an empty movie clip. I have a toggle button controlling volume fade up and down. I also have navigation buttons that fade the volume of the sound object down with the same code as the toggle button. When the movie loads, the sound plays and the toggle functions. When the navigation button is pressed it also works, but I can't get the sound to restore, even though no stop command has been triggered.
Any ideas? What I want to happen is this: Song plays, toggle button allows user to turn down volume to off, navigation button turns volume on song down while viewing a page. Upon hitting an "exit" button, a new song will play in the background, and the toggle button will function as before, until a new navigation button is pressed.
Sound Toggle
I would like to create a button that
1. If sound is playing in background, it will stop the sound.
2. If there is no sound playing in the background, it will start playing the sound.
Basically a mute button, but for all sounds playing.
Any help is greatly appreciated. Thanks.
Sound Toggle On/Off
Hi
Ok i'll try not to confuse anyone with what im gonna ask so here goes.
Ive got a button on a layer called 'toggle' that allows me to turn some music on and off - the music is in a sepearte movieclip called 'soundtrack' on a layer called 'soundtrack - and it works fine.
However if i turn it off, it begins to play again after one of the movieclips called 'background' within the site loops??
Below is the ActionScript im using on the button to control the music:
on (release) {
if (music == true) {
music = false;
stopAllSounds();
} else if (music == false) {
music = true;
Soundtrack.gotoAndPlay(1);
}
}
I cant understand why it begins to play again after i've turned it off? any help with this would be greatly appreciated!!
also i have a layer named actions that initialises the load sequence to the whole flash movie that has the script:
music = true
again if anyone can help its appreciated
THANX
Ben.
Sound On/off Toggle
Could someone tell me why this doesn't work?
I'm combining a couple different ideas from Kirupa tutorials and Flashkit movies.
Basically, its just two buttons (on, off). One in frame 1 and one in frame two of the timeline. I've attached AS to frame 1 to load and start the music. I've attached AS to each button to "supposedly" control its "onrelease" action.
The load and start sound works fine, but the buttons don't seem to have any effect.
Here's the fla. I used a Buffy The Vampire Killer sound clip to keep the fla small for sake of file transfer.
Sound On/Off Toggle
I need to create an on/off button that will turn the sound on/off in a flash movie. My sticking point is that the sound in question has to be synced up with specific events in the movie. It's not simply a background loop. Any idea how I should accomplish this.
Button Sound Toggle
I've posted this one before - hoping you can help this time
Can anyone explain to me a way to turn ALL my BUTTON sounds off using one toggle button?
I know how to control a sound object playing a background sound.... but what about the sounds which exist in the rollover and hit frames of my buttons???
I tried to dump all of the rollover sounds into a single clip - and play the relevent sound via an actionscript goto line. HOWEVER - it causes jumps and pauses in my menu animation. So... how the hell do I control the volume of these sounds?
Why the f**ck isn't there a universal volume control in Actionscript?????? And if there is, where the hell is it?.. and can you show me the way to a tutorial or open source fla so I can work it out? The only thing I can find is: stopAllSounds (); But, what about starting them again????
I've found squillions of tutorials about controlling sound... but not a single one which explains how to place and control button sounds. All the tutorials I've seen just blabber on about controlling a background sound (which is an easy one to solve) For some reason, it's going right over my head - but I bet it's as easy as hell once ya know how!! *LOL*
I'm stumped... can anyone help??
cheers.
Actionscript: Toggle Sound On/Off ?
Is there a Toggle Script for a sound button?
Example:
Say I have an MC on Level 3 with 2 frame labels, PLAY & STOP.
I have a button on Level 1 that I want to toggle between those 2 labels everytime the button is clicked on.
Basically, I guess I'm looking for an IF/THEN statement to make this happen on one button instance if possible.
Or is there a STOP ALL SOUNDS toggle script? cause that would be even easier. You guys are the bestest!
Tone.
Toggle Sound With One Button
Hey guys,
ive gone through the tutorials and everything, however, i could not find one that came to my specific needs. My flash movie has sound. it plays throughout the entire movie including each scene. however, im looking to make a toggle button to stop the music when they click it, and then if they want it on, click it again and the music will start again. I've thought of muting it, but then i cant restart the music when they want to hear it again. any suggestions?
Sound Toggle Flash5
There has to be a simple way to toggle sound on/off from a single button..
what am I doing wrong?
on (release) {
if (musicon="1") {
music1.stop();
musicon="0";
}
else {
music1.start();
musicon = "1";
}
}
Thank you.
Toggle Buttons For Sound
I am trying to have my movie have music that a viewer can turn off if they want with a button. I've tried creating a seperate sound.swf file and targeting it, but I can't get in Flash 5 how to put in "end tell target" and "end on". My action scripting looks like this:
On (Release)
Begin Tell Target ("_leve 1100")
Go to and Play ("Music Start")
Then I should have
"End Tell Target"
"End"
right?
If I don't have those End parts is that why it's not working? How do I get "End" in Flash 5? Or do I use "With"? I just need my viewer to be able to turn the music off if they want, nothing fancy. Any help would be much appreciated..
Sound Toggle Button
I have a large training piece that is broken up into sections. Each section has it's own soundbyte. I'm wondering if there is an easy way to have a sound toggle button allowing users to turn the soundbytes on/off. Any ideas on how to code this?
:(simple Sound On Off Toggle
I've been searching and searching for this simple solution to my problem for so long i think my face has actually turned blue.
I want actionscript for my single button on my stage that will turn off and on my sound object thats on scene 1 from any scene!
Code:
var mySound = new Sound(this);
mySound.attachSound("song1");
mySound.start(0,999);
please please help me!!!
Sound ON/OFF Toggle Button
i have two buttons, on and off.. in my movie.. when the user enters the sound is on, when the user releases off button, i want ALL the sounds in my movie to be turned off..
how do i do this with my previous code. The code i pasted here works for the rollover, rollout, release, just not the sound.. i should mention that i used this code to create my sounds...
var mySound:Sound = new Sound();
//whichSound:String is the linkage name of my sounds from the library)
function playSound(whichSound:String) {
}
//here is an example of a sound that i need to call from the timeline
function transitionSound() {
_level0.playSound();
mySound.attachSound("transition");
mySound.start();
}
heres my on/off code:
function initSoundButton(obj:MovieClip) {
var lastClicked:MovieClip;
var soundArray:Array = new Array();
soundArray.push("onButton");
soundArray.push("offButton");
// Loop through state button array & initialize handlers
for (var i = 0; i < soundArray.length; i++){
var curBtn:MovieClip = obj.soundButton[soundArray[i]];
//trace("current button" + curBtn);
//trace("OBJ sound button " + obj);
// Set default button
if (i == 0) {
curBtn.select = true;
lastClicked = curBtn;
curBtn.gotoAndStop("released");
} else {
curBtn.over = false;
curBtn.select = false;
}
curBtn.onRollOver = function() {
//trace("THIS " + this);
if (this.over) {
this.over = false;
} else {
this.over = true;
}
if (!this.select) {
this.gotoAndPlay("rollOver");
_level0.playSound();
mySound.attachSound("rollOver");
mySound.start();
}
}
curBtn.onRollOut = curBtn.onReleaseOutside = function() {
if (this.over) {
this.over = false;
} else {
this.over = true;
}
if (!this.select) {
this.gotoAndPlay("rollOut");
}
}
curBtn.onRelease = function() {
if (!this.select) {
this.select = true;
this.gotoAndStop("released");
_level0.playSound();
mySound.attachSound("hit");
mySound.start();
lastClicked.gotoAndPlay("rollOut");
lastClicked.select = false;
lastClicked = this;
if (!this == 1) { //this part is not working correctly...
trace("sound are off");
} else {
trace("sounds are on");
}
}
}
}
}
Sound Toggle Problems
I am creating a cd in Flash.
Frame 1 is an intro page that directs to frame 2.
Frame 2 starts background music and directs to frame 5. It also houses main buttons for the home page (frame 5), exit and a sound toggle.
Frame 5 is the home page with buttons that direct to several other pages that direct back to frame 5.
Here is the problem. I have the sound toggle set-up to start and stop the sound. Once you have the sound stopped and you select another frame/page from the list on frame 5...everytime you hit the home button the music starts again, even though the home button takes you to frame 5 and the keyframe for the music is frame 2.
I'm new to all of this so I'm a bit frustrated. Is there a code that can be put in frame 5 that states "if the music is on leave it on and if it's off leave it off", or is there a way of coding the toggle that will not allow this to happen?
Thanks
Toggle Button W/o Sound
hello again.
i'm trying to create a projector w/ window functionality,
ie. close, max, min
i got the close no problem but now i'm stuck w/ the minimize-maximize button.
anyone have any good resources on how to make a simple toggle button that would suit my needs.
thanks,
Sound Toggle Button Help
i wondered if anyone knows how to do a sound toggle button to play and stop a sound clip
thanks
Sound Toggle Using StopAllSounds();
I have created a game where all the main actionscript takes place in one frame.
For extra functionality I was going to add a button to toggle on/off sounds, after searching this forums and others Im left confused how to implement this.
If i choose to use stopAllSounds() Im aware it only stops the current sounds and will not interfere with sounds about to occur.
Collision detection and random sounds occur within my game on an interval, is there a simple way to turn off all sounds permenantly?
The only other id would be a button with a toggle and use multiple IF statements to check status of sound on/off.
Thanks
Rob
Toggle On/off A Looping Sound
I know this one's easy on you guys...
How do you loop a sound and control it by a toggle button. I want my sound to automatically load when the movie clip loads.
anyone?
Toggle Sound Actionscript 2.0
Hello,
I have a button, just one button, that I want to be able to use to toggle sound on and off. On the button I have included the following actionscript:
on (release) {
stopAllSounds();
}
Toggle Sound Actionscript 2.0
Hello,
I have a button, just one button, that I want to be able to use to toggle sound on and off. On the button I have included the following actionscript:
on (release) {
stopAllSounds();
}
Can I add additional script to turn it back on again? Maybe an if statement? The sound is currently being loaded and I cannot really add additional frames to make this work. I have to be able to include the script in one step if possible. Unless a movie with several buttons is the only way to go.
Thanks!
Toggle Button W/o Sound
hello again.
i'm trying to create a projector w/ window functionality,
ie. close, max, min
i got the close no problem but now i'm stuck w/ the minimize-maximize button.
anyone have any good resources on how to make a simple toggle button that would suit my needs.
thanks,
Simple Sound Toggle Button
I want to have an on/off button for some background music(Just a short loop that will play over and over). What is the simplest way to do this? I can't seem to quite find a tutorial on this site. (Or maybe I missed it) Thanks in advance for any help!
Problem On My Sound Toggle Button
I am facing a problem for my sound toggle on/off button. I'm working on an introduction piece that has background sound loaded when the movie is launched. I need a sound toggle on/off button to control the background music. Attached here is what I have done..but there are 2 problems here.
1st problem: When I click on the “sound On” button in order to turn off the music, it didn’t turn off the music instead the music is played again, therefore I have 2 background music playing concurrently.
2nd problem: The “Sound On/Off” button – my “sound on” button always displayed whenever I go to other scenes although the music is turned off. The button should display according to what I have toggled regardless of the scenes I go.
i'm a graphic designer and not much of an actionscript coder, and i need a little help getting started here. any help is appreciated.
Probem On Sound Toggle Button
problem on my sound toggle button
I am facing a problem for my sound toggle on/off button. I'm working on an introduction piece that has background sound loaded when the movie is launched. I need a sound toggle on/off button to control the background music. Attached here is what I have done..but there are 2 problems here...need experts to help in solving my code..
1st problem: When I click on the “sound On” button in order to turn off the music, it didn’t turn off the music instead the music is played again, therefore I have 2 background music playing concurrently.
2nd problem: The “Sound On/Off” button – my “sound on” button always displayed whenever I go to other scenes although the music is turned off. The button should display according to what I have toggled regardless of the scenes I go.
i'm a graphic designer and not much of an actionscript coder, and i need a little help getting started here. any help is appreciated.
Streaming Mp3 With Sound Toggle Fader
Hi folks,
What I'm looking to do with the attached file is call up the published swf on my main page using loadMovieNum("sound.swf", 2);
What's happening is that the sound graphic appears, but the sound isn't playing?
Any ideas why this is?
P.S. Forget the mp3 that is on the file - it's the only sound I have thats small enough to ensure the fla is a reasonable size to attach!
Thanks.
Heeeelp - Sound Toggle Problem?
Im new to this as/ stuff and finding myself a bit lost on sound control in MX. I have various buttons with sound files attached to their down state. I want to have an on/off toggle which will switch off all sounds globally regardless of their location - is this possible?
All the tutorials I have found refer to looping bg music etc embedded in the same mc - is there an example out there that will show me how or does anyone have some script expertise they dont mind sharing.
Any thoughts welcome - the simpler the better!
D
Sound Toggle On Template File
I have a Template file I am editing that plays music in the background. I want to shut it off when a Video is loaded so I added a stopAllSounds to the button. Works fine; however, I cannot figure out how to turn it back on again, as the template designer placed the sound file into a button rather than creating a sound Object. Was hoping someone could help me figure out how to restore sounds (I have tried adding Frame Labels to his sound movie/button but it returns me to the opening on the animation.
I have posted the file here if anyone would like to help. If no time for that, is there a simple way to output what is happening when I hit the toggle button, so I can copy that and try it?
Thanks again in advance.
|