ActionScript 3 :: Menu With Active State Shown On Click
Jan 18, 2010
Ive got a simple menu that upon hover of each item, plays a movie clip, then on mouse_out it plays the movie clip in reverse. What I'm trying to do is to have a third state (active) that is shown upon clicking. I'm thinking I need to do something along the lines of:
-When clicked, gotoAndStop(5) //Five being the location of my active frame
-Also remove the event listener that triggers the function to play the movie in reverse.
-Then when another menu item is clicked, re-add the event listener to the previous menu item so it's not stuck 'active'
My code is as follows:
// Imports
import fl.transitions.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.external.ExternalInterface;
[Code] .....
View 2 Replies
Similar Posts:
Feb 11, 2010
Here is the code on my buttons, which work fine.[code]....
How do I setup these buttons so that when button1 is clicked, and the button1 page is loaded, that the button stays in 'Over' state?
And just to elaborate, when button2 is clicked and loaded, I want button2 to be in 'Over' state while button1 goes back to normal.
So basically, how do I highlight the active menu item with my 'Over' state?
View 1 Replies
May 11, 2010
how to make flash menu in active state.when i click one other button the first button remain on rollover sate and do not become active. see for your self.
View 4 Replies
Dec 11, 2005
I've used the tutorial for the XML Driven Drop Down Menu to create the main navigation for a site i'm doing, it's all working fine except I want to keep the 'current' area highlighted after it's clicked on. The rollOver events are defined in the AS but when I tried adding a function to change the colour of the item it either had no effect or broke the nav eHere is the code (from Sen's tutorial modified with new actions):
Code:
// generates a list of menu items (effectively one menu)
// given the inputted parameters. This makes the main menu
[code].....
View 4 Replies
Jan 17, 2004
ive followed Senoculars drop-down menu tute [URL], awsome stuff, but it seems the submenu's dont disappear to well when you roll out. ..They only disappear if you click on another menu item or when you click outside the menu.
View 12 Replies
Feb 12, 2009
when a user rolls over a button, the button plays the "open" frame inside the button. When the user rolls off the button, the button plays the "close" frame of the button. When a user presses the button, the button goes to the "dock" frame of the button. Here's the problem : when a user clicks a button, all the other buttons go to their "close" frame when only the button that's previously open when the user clicks a differen button should go to the "close" frame.
More emphatically, a function is needed to check to see if any buttons are in the open state (not a frame 1) when a user clicks a buttons. The way the code is now, when a user clicks a button, all the other buttons go to their "close" frame when only the button that was open should go to their "close" frame. Thus, if any button is not open when a user clicks any button, then, that button shouldn't do anything.
[Code]...
View 2 Replies
Jun 3, 2010
On this fla file I am having troubles creating an active state for the bikes.I have this great scrolling affect in place which is working pefectly, however now I want each bike to have an affect when you click on it?
View 9 Replies
Apr 6, 2010
I tried doing a search here and online. Most of what I found was buttons controlled via XML.I'm trying to make an "active state" button.I have 3 buttons. When a user clicks on the button it stays an active color. When the user selects another button the active color goes back and the current button stays on the color.Does that make sense?here's the code I have so far:
Code: Select allbutton1.addEventListener(MouseEvent.MOUSE_OVER, redover1);
button1.addEventListener(MouseEvent.MOUSE_OUT, redout1);
button1.addEventListener(MouseEvent.CLICK, redclick1);
[code].....
View 2 Replies
Jun 27, 2006
I have 8 buttons made from the same movie clip button with different states (up, over, out and active).Now I want to get the button stay active when the cursor moves to the next button to let the end user know where they've been.
View 2 Replies
Jan 4, 2008
I've found two good techniques for implementing menus with an active state, these are not mine. One is very simple but elegant. The other is more script. But who says more script is always better? Could I get some opinions on which you prefer and why? Do you have a better technique perhaps?[URL]..
View 3 Replies
Feb 9, 2009
I've been attaining help with buttons and movieclips here, and I got awesome code from cbeech.The buttons code I'm trying to write will keep a button in the active state when pressed, and if any other buttons are in the active state, they will close up...Im posting alink to a flash file of the effect i want in actionscript 2.0 . However, I need the effect/code in actionscript 3.0. and I need it to be modular where I can easily add or remove buttons to my heart is content.
Put more clearly, when a user rolls over a button, I want the button to play the "open" frame in the button/movieclip. When the users rolls off the button, the button/movieclip goes the "close" frame in that button/movieclip. If the user presses the button, the button/movieclip plays the "open" frame and will stop at the stop (action) to stay in the active state, and if there are any other buttons open, they should go their respective "close" frame and play from there. Here's my starting code. please bear with me; Im just migrating from 2.0:
[Code]...
View 1 Replies
Sep 8, 2009
I'm looking for an AS3/XML parsing pro to help me with an issue I'm having. The following xml file loads 7 icons ("url") into an array. What I want to do is create an activestate using child ("activestate") that replaces the "url" icon when clicked. I have no idea what the best way to do this would be. I've tried everything. The reason for this application is if i decide to change up the content down the line I won't have to recode anything. Just update the icons.
xml
<?xml version="1.0" encoding="utf-8"?>
<images>
<image>
[code]....
View 2 Replies
Jan 14, 2011
I am new to actionscript 3. I have created buttons with up/over/down states. The button changes colour during the over/down frames.How do I keep the over or down state active until the user clicks another button?
Right now when the user puts the mouse over the buttons, they change colour, but it goes back to the original colour once they click off. I would like it to remain on the changed colour so that the user remembers which button s/he's pressed until the another one is clicked.I came up with the following code in actionscript 3 and got it to partially work:
ActionScript Code:
btn1.addEventListener(MouseEvent.MOUSE_UP, startTransparent)
function startTransparent (e:MouseEvent):void{
btn1.alpha = .6;
}
So when it's in the down state, I get the transparent state and stays there. But how do I get it back to normal when the user clicks on another button?
View 7 Replies
Jan 11, 2007
I have created an image gallery that loads from an XML file using mostly previous Kirupa threads. From Scotty's code (I think -- my head is moosh now) I got numbered buttons for navigating between the images.Each button is a movie clip with different labeled frames for "up", "active", "hover", and "down" states. I'd like to have the numbered button change color when its image is on view and then change back when a different image loads, and I can't figure out how to do that. I know part of the problem is that the onRollOut function overrides other changes, so I'm willing to give up the rollover effect if necessary.[code]
View 1 Replies
Aug 22, 2008
I want to have a button with a rollover state that is different that the out state. I got that part, but I also want to keep the rollover state active if clicked. I can think of a couple ways to do it but I'm certain there is an easier way to do it. I have about 8 buttons and when I click on on I want that to stay in the rollover state, then when I click on another one I want the first to go back to the out state and the new one that I clicked to go to the over state and stay there.
View 3 Replies
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
May 13, 2010
When Flex MenuItem is clicked, the icon gets shown twice. One on top of the other.i.e. SubMenu A1 is doubled:
View 0 Replies
May 11, 2009
I have 3 images... I created 3 movie clips for each one (a_mc, b_mc, c_mc). It shows up as one behind the other, but what I want is to: click on the movie clip that is shown as the last one (or the second one) and have it appear at the front (a swap with the first) with a nice transition.
var mcA:Array=[a_mc,b_mc,c_mc];
for(var i:uint=0;i<mcA.length;i++){
mcA[i].addEventListener(MouseEvent.CLICK,f);[code]....
View 4 Replies
Mar 15, 2006
I'm working on a flash website which is published as a 100% x100% with no scale but I want to add a menu wich has to been shown always at the left of the screen. At home I've got a resolution of 1024x768 but on my work 1920 x 1200. In both cases I like to see the menu in left. Because i like to design some sort of paper strips wich are only visible for like a bit. On a mouseover it will be totally visible. Do I need to add some actionscript with a screensize detection and then some code with _y _x and stuff to place it or do I need to change the settings for the html publish? An example for the website at [URL]
View 5 Replies
Jan 27, 2010
The menu is like this http:[url]... (the site is in portuguese but it doesnt matter), when I click in on menu the actual menu does an alpha to 0 and the next menu appears using the alpha from 0 to 100 (and some animations like the cellphone going up).Now, how can I do a menu like that, whatever the menu I choose, it does that alpha animation ?
View 1 Replies
Apr 16, 2009
i'm working on a project where i would like to build a menu of 3 buttons in the bottom of my screen, when 1 of these buttons is clicked a little popup MC pops up with a X sign to close it. WHen the popup is active the background (the buttons) fade to a 30% alpha and a re not clickable anymore. When i close the popup MC with the X sign then the buttons are active again. I seen a tutorial how to do this but i lost it.
View 2 Replies
Mar 3, 2010
I'm currently working on an AS3 scripted drop down menu and for the most part it works exactly like I had envisioned with one small hiccup. The issue I have is if you accidentally navigate away from a button that creates one of my drop downs before the script has finished running the other drop down buttons will drop down but not be active until you go back to the original button and finish the script. What I believe will fix the problem is to disable the other main menu buttons until the script has finished. I could just disable at the beginning of the script and enable at the end but there are 5 flyouts and 9 buttons on the main menu. This would add up to a ton of extra code. So how could I create a block of code that disables the buttons and another block that will enable them at the end of the script but be able to call them in each script?
And here is my site that I'm currently working on. [URL]
View 1 Replies
Feb 12, 2010
Here is the code on my buttons, which work fine.[code]...
How do I setup these buttons so that when button1 is clicked, and the button1 page is loaded, that the button stays in 'Over' state?
And just to elaborate, when button2 is clicked and loaded, I want button2 to be in 'Over' state while button1 goes back to normal.
So basically, how do I highlight the active menu item with my 'Over' state?
View 4 Replies
Aug 21, 2010
If you have a look at the attached sliding menu there are four buttons. Each button brings an image in place. I want the button that�s been clicked to remain red until I hit a different button, even when the cursor is not right in front.
View 3 Replies
Feb 13, 2012
I'm updating this site for a client:
[URL]
I can't get "Motion" and "Press" to show as active. Basically this is done via a gotoAndPlay function, but it's not working. In addition, the code also deactivates the menu item when it's active; so, if I was on "Profile" before going to "Web" or "Press," that item remains inactive once I've clicked on "Web" or "Press," so I can't click on "Profile" again until I go to any of the other pages.
Below is the code for the navigation. Also, there is an external file named BookSection.as that I believe contains the code we would need to edit, I just can't figure out what it is - I've tried several edits.
You can find here (I couldn't upload since I don't have more than 50 posts):
[URL]
ActionScript Code:
mLogo.gotoAndStop("complete");
// PRINT------------------------------------------
booksButton.onRelease = function()
[Code].....
View 0 Replies
Feb 12, 2010
I found this script but it doesn't work. My buttons are not in a movieclip, and the instance names are but1-6.[code]The script is on a new layer called actions. Can anyone tell me why this script has NO effect whatsoever?
View 1 Replies
Oct 29, 2009
i've some flash elements in a php page, one of these is a menu that open some php page (target: _top) I do not why, every time it has to be clicked several times to go at the correct page, seams that it need to bee first activated with some clicks
the menu is in (and open) these pages (left column, snow, x-mas, and scuola logos):
[Code]....
View 2 Replies
Mar 31, 2010
I have created a menu with XML & AS3, which works nicely.But, I just met a problem. If I want to highlight a menu item which I just clicked, and it will disable the highlight after I click another item in the menu. How could I do that?
View 3 Replies
Jan 6, 2011
i have movie clip buttons on main timeline, i want that the buttons should be active (as they are on mouseOver) when click on them, and become back to normal when other button is clicked....
button AS2 is:
Code:
on (rollOver)
{
gotoAndPlay(2);
}
[Code].....
View 2 Replies
Mar 23, 2009
im having trouble making the buttons within my drop down menu active.basically, on the main timeline, i have a movieclip, and within it have a button that once u roll over it, will go to another instance in that timeline to display a drop down menu located below it (with buttons). these buttons do not perform any actions to the main timeline regardless where i place the actionscript or how i point to those buttons.
View 1 Replies