Flex :: Menu Created On Button Click?

Jun 19, 2010

I created a Button in MXMXL. On button click, I create a Menu as a child of the Button. I am using an XML datasource. The reason for creating it this way, was due to the amount of custom skinning involved. A popupmenubutton was not an option. Anyway, so my question is this: when clicking the button, the menu is displayed. However, if you click the button again, the menu reopens. I want the menu to close if the user clicks the button a second time. Now, I got it to work by setting a var after opening the menu, and then I check that var on each click to make sure that the menu isn't already open. If true, then it will close the menu, instead of reopening it. This works, until the user clicks away, in which the HIDE event gets dispatched and the menu closes. My hack no longer works.

View 1 Replies


Similar Posts:


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 :: Senoc's Drop-down Menu - Only Disappear If Click On Another Menu Item Or When Click Outside The Menu

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

ActionScript 3.0 :: Menu - When I Click On The Button , Alpha Return To 1 For The Previous Button?

Jan 12, 2011

i was making asimple menu .

ActionScript Code:
var currentLink:MovieClip = a_mc;
//buttons mode[code]...........

when i click on the button the alpha of this button will be 0.5 , when i click on another button the alpha of the previous button is still 0.5 , and so if i clicked on all buttons the alpha of all buttons will be 0.5,,,i didn't want that , i want when i click on the button , alpha return to 1 for the previous button .

View 5 Replies

ActionScript 2.0 :: [F5] Button [renamed] - When Click On The Menu Button A Image Will Popup In The Ipod Screen

Jan 1, 2007

i new to actionscript and am not sure where to begin so i will explin what i would like to do. i have a myspace site that i have created a div overlay with...<a [URL] now what i would like to do is use actionscript so when you click on the menu button a image wil pop up in the ipod screen and when u click the play button something else will pop up

View 6 Replies

ActionScript 3.0 :: Add A Back Button Once Click A Main Menu Button?

Apr 9, 2008

I'm trying to add a back button once I click a main menu button then remove the back button once it is pressed. I get the title error.

[Code]...

View 6 Replies

ActionScript 2.0 :: Click Button In One Menu And Deactivate Same On Second

Feb 24, 2010

Is it possible to do this: Have two separate menus on web page. Want to reload or send some variable or any kind of way that if you click any button in one menu it also deactivates any pressed button in second menu...

View 1 Replies

ActionScript 3.0 :: Flash Menu - Two Click Functions On One Button

Feb 23, 2010

I'm making a menu in flash and I want that when I Click the button/movieclip moves up and when I Click again it moves down again. I already did it with MOUSE_OVER and MOUSE_OUT but that gave me problems.

Here is the Code:
Actionscript Code:
//Eventlistenersmenu_over.buttonMode = true;
menu_over.addEventListener(MouseEvent.MOUSE_OVER,onOver,false,0,true);
menu_over.addEventListener(MouseEvent.CLICK,onOut,false,0,true);
//Functionsfunction onOver(e:MouseEvent):void {menu_over.gotoAndPlay("menu_op");
}function onOut(e:MouseEvent):void {menu_over.gotoAndPlay("menu_beneden");
}

View 1 Replies

Actionscript 3 :: Remove Button On Right-Click Menu Option?

Jun 12, 2011

A "Remove" context menu item is to be shown when the user right-clicks on a button. If the user clicks on the "Remove" option, that button should be removed from its Tile parent container. How would I implement this using Flex 3 and ActionScript 3?

View 1 Replies

ActionScript 3.0 :: Menu Button Click To Load External SWF

Jun 26, 2009

I was getting in to transitioning from AS2 to AS3 a while back and had designed a page that had menu buttons that when clicked, loaded an external swf in to a container. Pretty simple accept for the fact that it was a while ago and my computer crashed so I'm having to redo this and learn it all over again. I have read in to flash on the subject but I am not to sure on the best way to go about this. I know there are a lot of people on here who make thing a lot more simple and structured than I do. I'm so used to putting the actionscript on the button and I'm a little stuck on the best way to combine the actionscript for the button and loading the swf. I would need to make a button load an external swf in to a container when clicked? I figure I just need one and then I can copy it to all the other menu buttons.

View 2 Replies

Flex :: Click - Making A Dynamically-created Label In ArcGIS A Clickable Hyperlink

Mar 2, 2010

I have an ArcGIS map created with Flex. The labels created dynamically are the towns on the map. We have some PDF files that have some information about the towns on the map.

Is there a way to make those town labels clickable so that they can display the PDF information on a new page?

View 1 Replies

ActionScript 2.0 :: Make A Button That When Click It Returns Frame Menu

Jul 5, 2009

What code would I use to make a button, that when you click, it returns you to frame one. Gotoandstop doesn't work.

View 1 Replies

ActionScript 2.0 :: Menu - When Click On A Button It Scrolls Over Either Left Or Right To A New Content

Mar 21, 2005

does anyone know the tutorial that when you click on a button it scrolls over eitehr left or right to a new content kind of like this [URL]

View 4 Replies

ActionScript 3.0 :: User To Be Able To Rollover Menu Button And Click It When The Page Loads

Jul 31, 2009

When the page loads, the first menu button (PORTFOLIO) is automatically OnClick. I want the user to be able to rollover it and click it when the page loads. I attached my file.

View 0 Replies

ActionScript 3.0 :: When Click In On Menu The Actual Menu Does An Alpha To 0 And The Next Menu Appears?

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

Flex 4 RichEditableText With Right Click Menu?

Sep 13, 2011

I need selectable text that can be copied. Some users are used to copy with Ctrl+C (Cmd+C on Mac), and some are used to right click and select "Copy".

Using s:RichEditableText, there is no "Copy" in right click menu: http://d.pr/xWXW. Using mx:Text, there is "Copy" in right click menu, but it doesn't copy anything: http://d.pr/vtiw

Ctrl+C works for both s:RichEditableText and mx:Text.

Is there a property or something to enable "Copy" in right click menu for s:RichEditableText?

View 1 Replies

Flex :: Remove Right Click Menu In Swf?

May 25, 2009

i made swf using flash 9 player if i right click swf it will shows menu like zoom in , zoom out, etc option . but i saw this site url [URL] animation swf like elephant.swf, bird.swf... not show anything .only shows reddraw option How can i do like this ?

View 6 Replies

Actionscript 3 :: Hide Default Options In Right Click Context Menu In Flex?

Oct 16, 2009

I'm developing a flex application and I want to add it a context menu. I got it with this

code:
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();

[code]......

View 2 Replies

Flex :: Get The Reference To A Newly Created Button With Actionscript?

Mar 11, 2010

I have a MXML button:

<mx:Button id="myButton1"/>

How do I create N number of Buttons with Actionscript: myButton2, myButton3, myButton4... myButtonN ?

And how to get the reference to the newly created buttons right after they are created? Like I should be able to do myButtonN.x = 100 right after it's created.

View 1 Replies

Flex :: Make A Button Change It's Shape With Every Click (music Button)?

Sep 20, 2010

I want to design a music button for a game like geochallenge

View 1 Replies

ActionScript 2.0 :: Create A Custom Context Menu (right Click Menu) In Flash?

Dec 7, 2002

Anybody know how to create a custom context menu (right click menu) in Flash?

If it's not possible, wouldn't it be a good idea for Macromedia to put some kind of event or something in there?

View 11 Replies

ActionScript 3.0 :: Context Menu - Add A Right Click Menu With A Custom Item? ?

Oct 8, 2009

i wanted to place some credits item in the right button menu (no links, so no events, just a label with credits). i was looking the contextmenu help, and there is an example of how to add items, disable default items and so on, but i could not find how to attach the menu to the movie (the basic part). i tried both on 'stage' and it tells me that stage does not have a property called contextMenu, so i tried to attach it to a sprite, it runs ok and compiles ok but when i right click on the sprite i get the default menu

var _menu_item:ContextMenuItem = new ContextMenuItem("here goes [code].....

how to add a right click menu with a custom item?

View 3 Replies

ActionScript 2.0 :: Drop Down Menu When Click On Another Menu Item?

Nov 13, 2002

I have an array for my menu and submenus.It works fine, but I have to click again on the menu to close it.When it's open it's completly open it takes too much space.how I could make a menu close when I click on another menu item..this is the code on the frame on my main timeline:

MenuArray=new array();
MenuArray[1]=menu1;
MenuArray[2]=menu2;[code].....

View 1 Replies

ActionScript 3.0 :: Click To Open Menu Then Click To Close?

Sep 28, 2011

I've got a drop down menu. I want to click a tab to make it drop then, if it's open, click it again to close. I've tried a million variations on the script below:

var btn_grp1:String
function main1Down(event:MouseEvent):void {
if (btn_grp1 != "dwn") {

[Code]....

This works too (once). So the drop down buttons all disapear again, but it won't re-set. The drop down menu stays up from then on.

BTW i'm not set on this method, it just seemed the most obvious i.e. if menu hidden, then show it, set some variable to down (showing), else hide the menu, set var to up (hidden). Not working though.

View 2 Replies

Flex :: TextField Instance Inside A Button Created In A Separate Layer In Flash Is Null

Mar 25, 2010

I've created an button object in flash. The button contains 2 layers. One is the background image and on top of it is a textField. The textfield is dynamic. I use the button inside a movieclip and I export it in a SWC. The I'm trying to use it in flex.

I'm trying to do this:

var myComponent:MyComponent = new MyComponent();
myComponent.button01.theTextField.text = "Caption";

I get and instance of the button(myComponent.button01 is not null in Flex debugger), but the instance of the textField(myComponent.button01.theTextField) is null and I'm not able to change the text(but the default text appears onscreen). The code is compiled correctly in flex.

I exported the in swc the button control as well. So the button is not the default SimpleButton from Flash, but an derived class generated by flash(with the same name as the symbol defined in flash). It contains theTextField memeber, which is null.

Here is the button timeline(Layer 2 contains the textfield, and the textfield instance is named theTextField):

View 5 Replies

ActionScript 1/2 :: Click A Button On 2 Different Ways Shift Click Or Ctrl Click?

May 12, 2010

Lets say i have a button on frame 1. And if you press it normal, you ll get to frame 2. But then if you click it on another way, you ll get to frame 3. How do i do that easy?! With another way i mean like shift click or ctrl click or is it an easier way?

View 3 Replies

Actionscript 3 :: Flex : Get It's Value From A Var When Click On A Button?

Dec 7, 2011

I have a label that get it's value from a var when you click on a button. The var has already been declared:

public function clickevent
{
label.text = aVariable;[code]....

and aVariable is empty, label2's text is Null (it doesn't give an error, just "Null" in my situation).What I'd like to know is when I later on change the aVariable's value to a string "hasChanged", for example. The label2's text should also change to "hasChanged" without the user having to push a button or anything to make this change.

View 3 Replies

Flex :: Open A New Tab On Button Click?

Jan 17, 2012

I have a tab navigator which contains the 4 tabs Account, Configuration, System and Dashboard. In the Configuration tab there is a button labeled add new config. If the user clicks this button the system tab should open - how to do this?

View 1 Replies

ActionScript 1/2 :: Created A Drop Down Menu In CS4?

Jul 22, 2009

Here is my issue: I've created a drop down menu in CS4 using AS2. In my drop down menu, I'm trying to make the buttons link up to other scene labels, but it won't go anywhere. I have no problem linking to a URL, but for some reason, even when I use Behaviors to make the button Go to and Play at the scene I'm designating. I don't know enough about the scripting to figure out why this is happening.

View 3 Replies

Flex :: Change Button Appearance On Click?

Apr 26, 2010

I wahnt to change button appearance when it was clicked.

<?xml version="1.0" encoding="utf-8"?>
<s:Button xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"[code]..........

Is there a method using states? I could then use the skin convention.

View 2 Replies







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