Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Untoggle When Another Toggle Is Clicked



I have two toggle buttons that, when clicked, are rendered 'toggled'. However, I need to have specific events happen when one button is toggled - so - how would I have one of the buttons untoggle when the other one is clicked?The buttons are two frame MCs



KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 01-16-2008, 10:06 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[F8] Reset Pause/play Toggle When Replay Is Clicked?
I've got a pause/play toggle button for the whole movie, and also a replay button. When I've got the movie paused, and I click the replay button, then the pause/play toggle button is out of synch (says pause but the movie is now playing).

How can I "reset" the pause/play toggle button when the reset button is clicked?

The pause/play toggle is in a two-frame mc setup.

Thanks for looking.

If This Button Clicked Load Mc With This Text If This Button(different One) Clicked L
if this button clicked load mc with this text if this button(different one) clicked load same mc, with different text...is this possible?

Toggle MC On And Off...
hi guys,
I have a button that is nested within an MC. The MC is on the main timeline. Within the MC there are 2 frames, the first is when the button is 'off' and the second when it is 'on'. This works fine I can toggle the MC easily, but my problem is that I have 5 of these same MC/BUTTONS on the stage and if one is turned on and then another I want to turn the last one off or all of them of except the current MC,
thanks in advance,
tom

Toggle
very newbie question... whats toggle?
the toggle action didnt do anything to my button.

Toggle Between On And Off
I had a problem here with toggling.
I got 5 scenes each with a sound on/off button.
When i click on the sound on/off button to turn off the sound the button will change to Sound On. (meaning when you click on it again it will change back to sound off again which is the default)

Now the problem is, when i click on the button, it will be sound on.. but when i go to another scene the button will change back to sound off...(default). It shouldnt be that way, it should be display Sound On instead since i've toggled it.

How do i go about solving this problem? Anyone? Thanks in advance!

Toggle Key
I am trying to do a lever here, and have a toggle setting, but I can not find it. Basically, I got 3 different positions I want the lever to be in, and I'm using 3 jpg's. How do you set the toggle function? Thanks


Prindel

Toggle All The Way?
code:

function togglequality() {
if (control_mc._x == Math.round((Stage.width - control_mc._width ) /2)) {
_quality = "HIGH"
}
else {
_quality = "LOW"
toggleHighQuality;
}
}

togglequality();



hey,

I am abit confused at why this code will no work at the part where it is suppossed to toggle the swf quality back to "HIGH" once "control_mc" has positioned itself in the middle of the stage. i wrote it thinking that it would work, does anyone know the problem. here is the code for when "control_mc" repositions its self:

code:
control_mc.onResize = function() {
control_mc.tween(["_x"],[Math.round(( Stage.width - control_mc._width ) /2)]);
}
Stage.addListener(control_mc)
control_mc.onResize();


so when the "control_mc" moves it eases to the middle and while its easing the quality is set to "LOW" so when it gets to the middle "togglequality" is suppossed to toggle back to "HIGH"

anything i am doing wrong?

thanks

Toggle
how would i get one movie clip to toogle to diffrent things when pressed

like, play music, stop,
but not together just

*press* play music
*press* mussic stop

here is my action script so far


on (press) {
stopAllSounds();
}
on (release) {
aSound = new Sound(this);
aSound.attachSound("TATP");
aSound.start(0,999999);
}

thanks

3-way If/Else Toggle
I have several buttons which make visible different sub navigations - however some of the sub navigations are relative to more than one section.
The button code below works for the individual buttons, but I need it to say something like this:

- if Btn1 is selected myMC is visible.
- if Btn2 is selected myMC is visible.
- if both buttons are selected and the user deselects one of the buttons myMC is visible.
- if both Btn1 and Btn2 are deselected myMC is not visible.


Code:
Btn1.onRelease = function() {
if (myMC._visible == false) {
myMC._visible = true;
} else {
myMC._visible = false;
}
Btn2.onRelease = function() {
if (myMC._visible == false) {
myMC._visible = true;
} else {
myMC._visible = false;
}
does that make sense? thanks in advance...

Toggle
how would i get one movie clip to toogle to diffrent things when pressed

like, play music, stop,
but not together just

*press* play music
*press* mussic stop

here is my action script so far


on (press) {
stopAllSounds();
}
on (release) {
aSound = new Sound(this);
aSound.attachSound("TATP");
aSound.start(0,999999);
}

thanks

Toggle All The Way
function togglequality() {
if (control_mc._x == Math.round((Stage.width - control_mc._width ) /2)) {
_quality = "HIGH"
}
else {
_quality = "LOW"
toggleHighQuality;
}
}

togglequality();

hey,

I am abit confused at why this code will no work at the part where it is suppossed to toggle the swf quality back to "HIGH" once "control_mc" has positioned itself in the middle of the stage. i wrote it thinking that it would work, does anyone know the problem. here is the code for when "control_mc" repositions its self:


control_mc.onResize = function() {
control_mc.tween(["_x"],[Math.round(( Stage.width - control_mc._width ) /2)]);
}
Stage.addListener(control_mc)
control_mc.onResize();

so when the "control_mc" moves it eases to the middle and while its easing the quality is set to "LOW" so when it gets to the middle "togglequality" is suppossed to toggle back to "HIGH"

anything i am doing wrong?

thanks

Tween Ani Toggle
hi
i got two tween, when i click the button first tween has to appear and on second click the first tween has to disappear and second has to appear.

I have written the code

on (press) {
_root.edu._alpha=0;
_root.obj._alpha=100;
_root.obj.play();
}

it works fine when i double click on the button.

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;
}
}

-------- How To Do A Toggle Button ------------------
i want a toggle button so it has 2 options:
1. on
2. off
how can i do it?

thanx!!!!!!

>> 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

Toggle Buttons?
Hi.. I am making an interface for a website and I have some sound.. I spent 4 hours trying to figure out the correct sequence for a toggle button to turn it off and on.. The toggle button will turn if on if the sound isnt playing and turn it off if it is...

Can anyone help me with this?

Thank You!

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

Toggle Button
Hi guys,
I'm trying to create a toggle button that turns on/off a menu. I've tried a number of routes, including variables that are swapped when the button is pressed. i.e. if var=0 then display the menu and set var=1, if var=1 then hide the menu and set var=0. I cannot get this to work so if anyone has an idea then it would be greatly appreciated. p.s. I have the check to see what the variable is on the press action of the button and then swap the variable on the release action of the button.
Confused? I hope not.

Cheers

Keith

Toggle Button
I'm somewhat new to flash and I'm trying to create a pause button that toggles from pause to play. Here's the script I'm using on the button. It works but there's got to be a better way to do this. I admit, I suck at actionscript.

//brian

on (release) {
if (Number(button) == 2) {
tellTarget ("_root.MovieTest") {
play();
}
button = 1;
} else {
tellTarget ("_root.MovieTest") {
stop();
}
button = 2;
}
}

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.

X And Y Coordinates W/ Toggle
I have several buttons on the stage. When one of them is pressed I would like to move the position of all of the others. If it is pressed again, I want them all to come back.

What is the best way to set this up? Keeping file size down. I think it would be using x and y coordinates and a toggle? - if so, can anyone direct me to a good tutorial?

Thanks so much!
jd

HELP With Scripting X,y With Toggle For Mc
My query is this:

I have a mc call it A) on the stage when the file opens. on release of that clip (A), I want another clip (call it B) on the stage (placed outside the window) to move into the window. Upon releasing mc A a second time, I want mc B to move back out of the window.

I have the basics, but have simple clipEvent handler trouble I think.

Can anyone lead me to the right answer? Here is the script I am placing on mc A:

onClipEvent () {
}

i=1;

button.onPress = function(){



Cheers,
Christian
i++;

if (i==2){

mc_a._x = -94.6;

mc_a._y = 148.8;

i=0;

} else if (i==1){

mc_a._x = 137.5;

mc_a._y = 148.8;

}

}

Auto Toggle
UGhhh drivin me nuts,
I am (currently unsuccesfully) trying to create a simple auto on/off type toggle script in Flash.

What I have is a looping clip within my movie, with each loop, I wanted to alternate the alpha to 0 or 100.

Cheers Cylon

Toggle Buttons
Hi all,
Can anybody help me designing a Toggle button sort in Flash 5. Am a beginner so please stick with the action scripts.

What I mean by a Toggle Button is that : It stay s pressed when i press it once and pops back to released state when i click it again...

Also, how to detect a Double click....

Please Help me...

Thanx

Wishy

On/off Toggle Button
I have a button for turning music on and off. I see the command for stopallsounds, but I only want it to stop my background sound, not my mouseover sounds. And then I want it to turn the background sound back on the next time it is clicked (toggle).

Does this require an "if statement" of some sort?

Toggle Button
hi there,
is there any way to enable a button for toggle function???. on release, animation starts forward & on release again, animation starts backward

Please Help

Thanx in Advance
Rgds
Bhaskee

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

How Do I Toggle Quality?
Hi everyone,

Thanks for reading by the way. hehe, my question deals with toggling quality. I already know how to toggle high quality though. its like

on (release) {
toggleHighQuality();
}


But my question is how do you toggle quality so it goes to low, medium, high, and best quality. anyone?

Thanks the help.

Toggle At Intervals
Hi everybody,

I've got a movie clip called "modes" with only two frames and a stop action on each one. I want to toggle between these two frames at 10 second intervals. The problem with my code is that is keeps looping back to the first frame without ever resting on the second one. Here's what I've got:
_______________

function switchModes(direction) {
modes.alphaChange = -3;
modes.destinationframe = modes._currentframe+direction;
if (this._currentframe = 1) {
direction = 1;
} else {
direction = -1;
}
}

//change modes every 10 seconds
setInterval(switchModes, 10000);

//fade
modes.onEnterFrame = function() {
this._alpha += this.alphaChange;
if (this._alpha < 0) {
this.alphaChange=this.alphaChange*-1;
this.gotoAndStop(this.destinationFrame);
}
if (this._alpha > 100) {
this.alphaChange = 0;
this._alpha = 100;
}
}
_______________

Any ideas?

Thanks.

Toggle Button
I have a multi track player,and i need to toggle the mute on/off button according to the animation on the timeline.was wondering if its possible
some help would be nice
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

Toggle Buttons
For a Flash MX 2004 application I am making, I have made 5 different buttons that I (eventually) want to have playing seperate sound loops. I made all 5 pictures i have into buttons, with an "up" state (a grayscale of the image) and a "down" state (the normal image with color).

What I want right now is to have only one image "lit up" (1 image in color, the other 4 in the grayscale state) when I click on it, and for it to stay lit up when I release the mouse button.

Right now all I can do is click and hold the mouse button down to keep it lit up, instead of having a simple toggle switch.

I read in the help files that there is a way to make toggle buttons, something along the lines of

buttoninstance.toggle = true;

but I am a complete newbie to any sort of interactive Flash, especially anything with scripting

Sorry if this is in any way confusing, but any help would be appreciated

Toggle Key Command
Hi,

is it possible to toggle the actions of a key press so.

so press "m" once gotoAndPlay (2)
press "m" twice gotoAndPlay (1)

cheers,
G

Toggle _alpha
How can I toggle the alpha between three or more clips so that when the selected one is at 100, the remaining ones are at zero?

Toggle Buttons
I thought this would be easy but i'm having some trouble... I have 6 MC's which are my buttons. All of the buttons are set at 0 opacity on the main timeline. I'm trying to make it so when you rollover one it goes to 20% opacity (_alpha = 20. Sounds simple, but heres where the toggle comes in, if you click it, it sets the previous to 0 and makes that one 20%. I'm trying to do this without making 6 keyframes and having it go to that keyframe with the already highlighted button...Any ideas on how to go about doing this?
Thanks

Toggle On/off Button
how do you create a toggle on/off button to display a movie clip

click to turn on....then click to turn off

Run While Key Is Held Down/Toggle
Hey everyone, I am making a game and have a basic moving guy (birds eye view) he moves and all, but I was curious if anyone knew how to make him run by holding down a key, or toggling it..I have tried to Key.isToggled method but it doesnt seem to work, I currently want the SHIFT key to be held down, to increase his speed, and return to normal when I let go of the shift...or if thats to hard, simply tapping it on and off would work...

Heres the code I have right now, can somoen modfiy it, or explain to me what to do?


Code:
onClipEvent (load) {
speed = 5;
}
onClipEvent (enterFrame) {
if (Key.isToggled(Key.SHIFT))
speed = 15
if (Key.isDown(Key.UP)) { _rotation=0; _y-=speed;
gotoAndStop(2);
}
if (Key.isDown(Key.DOWN)) { _rotation=180; _y+=speed;
gotoAndStop(2);
}
if (Key.isDown(Key.LEFT)) { _rotation=270; _x-=speed;
gotoAndStop(2);
}
if (Key.isDown(Key.RIGHT)) { _rotation=90; _x+=speed;
gotoAndStop(2);
}
if (!Key.isDown(Key.RIGHT) && !Key.isDown(Key.UP) && Key.isDown(Key.DOWN) && !Key.isDown(Key.LEFT)) {
gotoAndStop(1);
}
}


Thanks for your time,
SS03

PS - I am using Flash MX 2004, Actionscript 2.0 ..if that matters...

Toggle Between Two Sounds
I imported a video (wmv embedded in a movie clip) into flash with sound. Now I want the viewer to be able to toggle between 2 sounds.
1)Turn off the sound of the wmv and play some other sound instead
2)Turn off the other sound and turn on the sound of the wmv

How do I do so in Flash (I am using 8 but I think it doesn’t really matter)

Toggle On Rollover
making an expandable menu
want to be able to roll over a button
to load a MC and i want the MC to stay
open until i roll over the button again.

i do not want a roll over and roll out

i want a toggle roll over...

how do i do it?

Audio On/Off Toggle
Hello,

Just completed an on/off toggle tutorial using play/stop buttons. It's based on creating 3 frames in the main timeline.

Frame Code
Frame 1
my_sound = new Sound();
my_sound.attachSound("soundbyte_01");
play();

Frame 2 and 3 (labeled play and stop respectively)
stop();

Button Code
PLAY BTN
on (release) {
_root.my_sound.start(0,1);
_root.gotoAndStop("stop");
}
STOP BTN
on (release) {
_root.my_sound.stop();
_root.gotoAndStop("play");
}

**It works great, but I cannot figure out-- if you create 3 frames (audio player layer) in the main timeline where everything else is on stage, and then you jump to "play frame" when clicking the play button, the movie will jump back to frame 2. How can a play/stop toggle be encapsulated in an MC so the MC containing the toggle buttons can be placed on a layer on stage without regard to the main timeline?

Am I overcomplicating this? Is there another logical approach to placing music players/buttons on stage?

THANKS!!!
-Casper

Toggle Button
I need a button which toggles from on to off.....I've seen some examples out on the internet which but none of them are very easy to use.....do you have a simple toggle button script?

[F8] Toggle Question
I may be wrong..but I thought I saw somewhere some code that was used to 'toggle' whatever action/boolean you choose.

the code was somethign with a ? and maybe a : between the two 'conditions' or something... I cant seem to find an example of this..

anyone got one?.. and what is this 'method' called?

thanks

Using A Toggle To Control An SWF
HI there
I was wondering if anyone can point me to a tutorial or provide help in order to create a toggle that controls the timeline of the movie.

So, say for example, I have a fla with 100 frames, I want the user to be able to control going from frame 1 to frame 100 by dragging a toggle left to right...

Let me know if you need any clarification.

Thank you!

[F8] Boolean Toggle
Bleh. My code for my game isn't working, and I can't quite figure out why it doesn't.

Right now I'm trying to toggle a boolean function between true and false, and it works for making it true, but any code I use after it won't work.


Code:
if (GotHat == true && HatFlip == false){
_root.b3.onRelease = function(){
HatFlip = true;
TextBox.text = "You flip your hat inside out.";
}
}else if (GotHat == true && HatFlip == true){
_root.b3.onRelease = function(){
HatFlip == false;
TextBox.text = "You flip your hat rightside-out.";
}
} else if (GotHat != true){
_root.b3.onRelease = function(){
TextBox.text = "You don't have a hat to flip!";
}
}


Now, the first and last bit of code works. If you don't have GotHat activated, it'll display that message "You don't have a hat to flip!" and if you have GotHat activated, it'll turn HatFlip to true.

HOWEVER, even if GotHat is true and HatFlip are true, that second bit of code won't work, so you never see "You flip your hat rightside-out." I stuck "trace ("this works!")" in there, but I never see it in the output window, so I suspect that the code is being skipped over.

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

[F8] 2 Toggle Buttons
I am trying to create a movie that is controled with a play button and a pause button. That tricky thing I'm running into is having 2 buttons alternate highlighting. So in a nut shell I'm trying to start with the movie in a paused state and have neither button highlighted, then when the user clicks on play... the play button gets highlighted and stays that way until they click pause... then the play button goes to normal and the pause gets highlighted... Vise-Versa. Thanks to anyone who may be able to help.

Help With Some Toggle Buttons
I have 3 movieclip buttons that should all be toggled together so that only one is activated at a time. I could think of a hugely obnoxious method of global vars but I am wondering if there is a cleaner approach? Any ideas on direction?

-mx

Copyright © 2005-08 www.BigResource.com, All rights reserved