ActionScript 3 :: Toggle Button - Hide / Visible On Click

Nov 6, 2010

I have a script that once clicked ( a button ) some other thing hides then once clicked again it re-shows. the problem is once hidden it never shows again here is the script:

menu_start.addEventListener(MouseEvent.CLICK, myClickFunction);
function myClickFunction(event:MouseEvent) {
// Hide the first and show the next here
if (menu_menu.visible == true){
menu_menu.visible = false;
} if (menu_menu.visible == false) {
menu_menu.visible == true;
}}

View 3 Replies


Similar Posts:


ActionScript 1/2 :: Movieclip Has A Toggle Button To Make It Visible True And False?

Jul 19, 2010

on frame 1 I've got 10 movieclips and each movieclip has a toggle button to make it visible true and false.
 
How do write the script to do the following on frame 10?
 
if only 1 movieclip is visible make one_mc visible true
if only 2 movieclips are visible make two_mc visible true
if only 3 movieclips are visible make three_mc visible true
... so on for all 10 hope this make sense.

View 10 Replies

ActionScript 1/2 :: Toggle A Boolean When Click Button

May 4, 2009

I would like to toggle my boolean value when I click my button. My boolean var looks like this: var playAllOn:Boolean = false; Then I have a button that calls a function to set the playAllOn to the boolean value it currently is not. So, if for example if playAllOn is false, I would like to call:

[Code]....

I know I could do this with an ifStatement in the myToggleBtn.onRelease, but am wondering if there is a better more efficient way to write this. Something like setPlayAllBtn(!= playAllOn); <!-- Obviously that one does not work...

View 3 Replies

ActionScript 3.0 :: Conditional Click States - Toggle Button?

Jun 25, 2009

I have a button hit state called btnWorkH, below is the start of my code to make it functional. The idea being, that when someone clicks the button, I add a child to the top, to make it look like it has been clicked and is maintaining an alternate color. How would I code this so that it becomes a toggle? As, I need a click (once this action has been performed) that removes the child... just not sure how to write the condition for this.

btnWorkH.addEventListener (MouseEvent.CLICK, workClick);
function workClick (e:MouseEvent):void{
addChild (workO);
workO.x = 62.5;
workO.y = 109.3;
addChild (txtAmy);
txtAmy.x = 105.1;
txtAmy.y = 109.3;
}

View 7 Replies

ActionScript 3.0 :: Get A Button To Toggle Playing Or Stopping A Mp3 If Click It Or Hit The Space Bar?

Feb 26, 2010

I'm trying to get a button to toggle playing or stopping an mp3 if I click it or hit the space bar. The code I have does that but it does something funny I don't understand. This is the code:

var s:Sound = new Sound(new URLRequest("song.mp3"));
var sc:SoundChannel;
var playtggl:int = 1;

[code]....

As you can see I've added two event listeners on the button, one for the mouse and for the spacebar. Thing is everytime I hit the spacebar, my function for the mouse click fires up. I don't understand how this is happening.Also, how do you have the event listener listen for a spacebar event without having to first focus on the button by clicking it with the mouse?

View 2 Replies

Flex :: Menu Control - Click A Button And A Menu Is Displayed. Click That Button A Second Time And Hide That Menu?

Jun 20, 2010

Basically, I have a button and on click it displays a menu. I want to click that menu a second time and the menu closes. Currently, every time you click the button, the menu reopens. I pasted the Flex livedoc example below. If you click the button, the menu keeps reopening.Now, I rigged it up by setting a var to open and closed, so when clicking the button it does a check. However, if you click away from the screen, the HIDE event gets dispatched, and the menu closes. This messed up the open close var being set.

How could I make this Flex example below show the menu on button click, and then on a second button click, it closes the menu? Take into affect that if you click away from the menu, it closes it.Also, I played around with the MOUSE_DOWN_OUTSIDE event for the button and set the preventDefault, and the FlexMouseEvent event.cancelable is set to false.Changing to a PopUpMenuButton is not an option. I have to much skinning involved.Here is the Flex example:

<mx:Script>
<![CDATA[
// Import the Menu control.
import mx.controls.Menu;

[code]....

View 1 Replies

Actionscript 2.0 :: Developing A Flv (streaming) Player - Add 'full Screen' Option (on-click Of A Button...say A Toggle One) To It?

May 5, 2009

I'm developing a flv (streaming) player and I want to add 'full screen' option (on-click of a button...say a toggle one) to it.

I've added <param name="allowFullScreen" value="true" />and it's working fine on my local machine but not on web.

View 3 Replies

ActionScript 2.0 :: How To Get MovieClip To Hide On Button Click

Jan 20, 2009

I got this code but when i click on another button is is still there how do i get it to disappear? I have two movieclip one is the snow and another movieclip is an empty mc called snow2

ActionScript Code:
i =0;
while (i<25) {
//duplicateMovieClip (dot, "dot" +i, i);
dot.duplicateMovieClip("snow"+i, i);
i++;
[Code].....

View 1 Replies

ActionScript 2.0 :: Set MovieClip Visible On Click Of Button

Feb 2, 2009

public function mc1():Void {
for (i=0; i<9; i++) {
c = c+30;
//here my_clip is a refrence to stage
var mc_new = my_clip.attachMovie("mc_bread", "bread_"+i, my_clip.getNextHighestDepth()+1, {_x:80, _y:385-c});
mc_new._visible = false;
[Code] ......
See the function visibility I am trying to set visible a movieclip on a click of a button. this code gives no error but still movie clip is not visible.

View 1 Replies

ActionScript 3.0 :: Show / Hide Window On Button Click?

Dec 23, 2011

make an graphic (just a box with text in it) be shown as default, then when the user clicks (either clicks the box or anywhere or a cross - anything!) the window is hidden, then if the user wants to see the box again, they can click a button saying 'show info'.

And I looked on the forums and found ( showthread.php3?t=66284" ) << I can't post links because my post count is too low .

But I tried that (both methods mentioned) and i can't seem to get them to do anything?

View 3 Replies

ActionScript 2.0 :: Hide/show Layers On The Click On A Button?

Dec 6, 2005

is there a way to hide/show layers on the click on a button?

View 2 Replies

ActionScript 3.0 :: Show / Hide Movieclip When Click On The Button

Sep 28, 2010

I just did a button and 3 movieclips. What i want? Well, when i click on the button to change the movieclips. click 1 = movieclip 1 when i click again on the button it change to movieclip 2 My problem is that i can`t make so it can change to movieclip 3.So when i click it must be something like this> click 1 = movieclip1, click 2 = movieclip2, click 3 = movieclip 3 so on...

[Code]...

View 2 Replies

ActionScript 1/2 :: Click A Button To Start A Movieclip And Hide The Previous One?

Mar 12, 2010

In my scene, I have five buttons and each one will start a movie clip within the scene.o, I have only one frame for the entire scene( but four layers: button,background(with music), action and my last one is animation.Each time a click a button( with onPress or onRelease actionscript 2.0.), a movie clip starts(that's ok..)But, when I click an another button, I want the previous movieclip to stop and disappear. In my case, the new movieclip starts but over the last one who is still there.Furthermore, when I want to click on a button that had already been pressed, I want him to start over his movieclip. For now, I need to press it once again to cancel his movieclip and then press it again to start his clip.In resumé, all I want is that each time I press a button, the last movie clip disappear because the new one starts and an already been pushed button, when pushed again, starts his movie clip without the need of pushing it to cancel his first operation and then pushed it again.

View 5 Replies

ActionScript 3.0 :: MovieClips - Remove / Hide Or Fade On Button Click

Aug 14, 2009

Basic problem here. I'm adding a bunch of movieclips using the addChild method. I simply want to remove/hide/fade them after a button click, but I am unsure of how to refer to the movieclips which I've just added.

Here is the code as it stands:
Code: Select allimport gs.TweenLite;
import gs.easing.*;
var strip:Bgstrip;
var contentBg:ContentBg = new ContentBg();
contentBg.x = 440;
contentBg.y = 166;
addChild(contentBg);
[Code] .....

View 1 Replies

Javascript :: Toggle Flash / Hide&stop Or Remove?

Apr 21, 2011

I am going to be setting up a control that can hide and show a flash video.I want to either stop it when its hidden, or remove it entirely. I've been able to do both, but which is better for the user.Hide and stop means its already loaded. But the flash object is still there, so I worry about it eating up processing power.Removing it entirely means no, its not there, but adding it again appears to send out a call to re-download the file.

View 2 Replies

ActionScript 3.0 :: Makes Button Visible...but Button Stays Visible If They Seek Back In Video?

Mar 30, 2011

when the video reaches 1 minute, a button appears. is there a way to hide the button again if the user uses the seek bar to go back to the 30 second (or any time before 1 minute) point?

View 2 Replies

ActionScript 3.0 :: On Click Object Visible Not Visible

Aug 8, 2010

I want to click on an object and make it appear and disappear. As the object is rectangular, I figured putting a white button the same size on a white background on a layer underneath the object would do this, but I can't seem to make it happen.I'm a complete novice, frustrated as I've been trying to achieve this all day and I'm sure it should be pretty simple, but could you give me the idiots guide. I know how to name an instance, make an object, script in actions on a separate layer. I would like to draw the button myself and give it an instance rather than drag it off the button component (as I can't work out how to make the component button white, change its size etc.!)

View 5 Replies

AS3 :: ComboBox Set Visible To False Doesn't Hide

Apr 1, 2010

I have a combobox in a view that receives information about application state changes, and then is supposed to show or hide it's children based on the whole application state. It receives state change messages, it traces the correct values, it does what it's supposed to do, however, it just doesn't seem to work. Essentially, all it needs to do is hide a combobox during one state, and show it again during another state.[code]

View 2 Replies

Professional :: Handling CLICK Event - If User Click Anywhere On The Stage The Search Bar Will Be NO Visible(OFF)

May 19, 2011

on clicking the Search Icon , a search bar will be visible (ON) if user click anywhere on the stage the search bar will be NO visible(OFF) OR user click on ICON again the search bar will be OFF but it Stage CLICK is triggered without clicking

[Code]...

View 1 Replies

Professional :: Hide Non Visible Layers During Test Movie?

Mar 23, 2011

I have a layer I am using for construction purposes, it shows though in test movie. If I go to publish settings and untick include hidden layers on the flash tab, when I test movie, my cars don't appear along the guide lines at all and just pop into view as movie ends. How does one hide turned off visibility layers during test movie without affecting hidden guide lines ?

View 1 Replies

ActionScript 3.0 :: Connecting Files ... When Click Down Onto The Toggle The Music And Timer Both Run At Once?

Mar 9, 2011

I have a game with a timer and toggle button that plays music. The AS3 file that runs the timer is the main doc clas(as3 file) and the timer is a custom event as3 file I made, is there a way I can link the 2 so that when I click down onto the toggle the music and timer both run at once.

View 1 Replies

ActionScript 2.0 :: FLASH 8 - Toggle Button/released State/pressed Button

May 18, 2007

I have a series of buttons inside an array. I am trying to get the buttons so that once they are pressed, they remain in the over state. Which is a darker color than the up state. So that people know which button they have pressed. Is there an easy way to do this for buttons?

View 1 Replies

Flash: `sprite.visible = False` Doesn't Hide Sprite Immediately?

Apr 4, 2011

I've got a sprite which I want to temporarily hide... But changing the .visible property doesn't do what I expect. The code looks roughly like this:

[Code]...

View 1 Replies

Javascript :: SWF Video With Controls (toggle Sound On / Off And Toggle Play / Pause)

Jan 10, 2011

I'm new to flash and just need to do a simple task but I can't manage to get it to work. I'm trying to import a video (flv) into a SWF container and need to AS functions which should be exposed to JS (using liveconnect or anything else). These two function should toggle sound on/off and toggle play/pause. I dont need any user interface or a full featured player, just these two functions.

View 1 Replies

2nd Click To Hide Pop-up Menu?

Oct 7, 2009

I have a Movie Clip configured as a Button and I wanted to know how to make the cursor transform into a pointer (little hand) when it's over tat movieclipBut well that was just not the point of the Post what really interests me is that when I click that MC a Pop up menu appears (another MC) but if i decide not to click any of the buttons in that menu the menu will stay there until I click another button or something and i will want it to disappear if a click it for a second time or something like that.

View 1 Replies

Professional :: Toggle Button Via The Button Component?

Oct 18, 2010

I'd like to learn how to use Components in Flash, and the documentation and tutorials I find are beyond my comprehension. I usually go to FlashKit and just rehash someone's code... but again, I'd love to learn how to use Flash Components.So I did a tutorial on the toggle button, but it was:1. Click button, and a window pops up at different location on canvas2. Click button again, and the same window dissapears.This is for a videogame, and I'd like a button to be click and that same button be populated with a new graphic. What I mean is, the graphic is a skull, and I'd like to have it start as a dark skull (as if a negative value) and when you click it the skull appears... click it again and it's gone (or that negative or dark skull representing it's off).So this differs from the tutorial I did because the pop-up window is the button itself, and the window that pops up would obstruct me from click it again.

View 3 Replies

ActionScript 2.0 :: How To Hide Mouse Right Click Menu

Oct 31, 2008

Is there a way to hide the right mouse click pop-up (settings & about flashplayer x). The swf i use is placed in HTML refering to two other pages with some java games. The problem is that this is running at a science center in a browser fullscreen. But people may not open a new window/tab (this happens when you click on "about flashplayer x). I found this: [URL] but is there something similar in AS2? I can use JS.

View 1 Replies

ActionScript 2.0 :: Play Video And Hide Upon End Or Click Off

Mar 1, 2011

I'm currently making a website for an assigment on movie websites. I'm currently trying to figure out how to get the video to play then fade / hide when it finishes or the user clicks the exit button so it will then reveal the page below. It's being built as a multi-swf site (ActionScript 2) and if I can get this figured out then I should be on my way to finishing the site.

View 2 Replies

ActionScript 3.0 :: Click Event Visible Not Working?

Sep 30, 2009

I have 7 images, 6 of which are hidden, and they're all stacked on top of one another. The Goal is to click the top one, make it disappear, and make the one below it appear. the subordinate layers need to be invisible so that the glow doesn't interrupt the glow above. Im not certain, but the imported images were converted to symbols as a Movie Clip, not a button, but i don't know if a button would still be able to maintain a layer filter...

Code:
//Create only one visible layer to avoid overlay problems (Indigo - Red)
Purple.visible = true;
Indigo.visible = false;
Blue.visible = false;

[Code]....

[URL]

View 4 Replies

ActionScript 2.0 :: XML Gallery - Click To View Or Hide Thumbnails

Jul 14, 2009

anyone know where i can find a AS 2 xml gallery similar to how this one works, with the slideshow, and click to view or hide thumbnails.[URL]

View 9 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved