I have a Flex app with a viewport that loads a series of other swfs. I would like to place a context menu over top of the SWFs when the user right-clicks. To that end, I have set up a fairly standard context menu where each item has a ContextMenuEvent.MENU_ITEM_SELECT event handler. One problem: The eventHandler never gets called.
If I place the context-menu code anywhere else in the app, i.e. not on top of a loaded SWF, everything works fine. However, when I place the exact same code on the SWF viewport, the context menu items appear, but the eventHandlers are never called.
I have a UIComponent (tried it also with Canvas) and some icons in it (sub views). On the UIComponent I defined some extra ContextMenuItems. Now when I'm testing it, the context menu appears only on the subviews (icons) with a right-click. I've checked the documentation but found nothing about required properties for using context menus. Why it's only on subviews?
Is there any way to know the parent/component which initiates context menu? I have a panel which contains different custom components. i want to open respective popup window of custom component from context menu when user right click on the respective component.
How can i find the parent custom component which initiates context menu?
for ex:
custom compoent: 1. Label, 2. Buttom
context menu Item: properties
On right click over 'Label' opens a context menu which has item 'properties', on clicking properties it should open custom popoup window showing properties of Label. similarly, for Button.
I am trying to listen Event on click of context menu, but it is not useful.
I have a Flex application, running with Flash Player, not AIR, that contains a Tree that I would like to put a custom context menu on.
Tried just doing <mx:Tree ... contextMenu="{MyClassWithStatic.menu}">, but that didn't do anything.
Went searching, and found this quote from some Adobe docs somewhere
In Flex or Flash Builder, only top-level components in the application can have context menus. For example, if a DataGrid control is a child of a TabNavigator or VBox container, the DataGrid control cannot have its own context menu.
so went upwards, trying each parent element until I reached my <Application>-element, which is consistent with what they wrote.
Tried making a Flex component, based on Group (the default) which contained my tree, and the context menu on the top-level element there, hoping it would work, but to no avail.
Is there any other way to manage this that I haven't found yet?
The code I use to create the menu:
var menuItems:Array = []; var rename:ContextMenuItem = new ContextMenuItem("Rename"); rename.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
I'd like to add copy and paste functionality to context menu in my Flex application. After creating a separate dummy project for testing, I realize that such options (cut, copy, paste, and delete) are already available in this dummy project without any coding. Both projects are compiled using Flex 4 SDK, run in the same brower (IE) and have the same version of Flash Player (10.2.153.1). However, different context menu are displayed. Here are the difference:
Orig Project: Print, Show Redraw Regions, Debugger, Settings, Global Settings, About Flash Player...
Dummy Porject: Cut, Copy, Paste, Delete, Select All, Settings, Global Settings, About Flash Player...
I am trying to find the best way to improve the user experience when interacting with a context menu in a Flex application. I already know that the context menu in Flex is quite limited in terms of how it is constructed and what it can show.
What I was hoping to do was to implement something similar to what Microsoft Word does in 2010 or later, where when right clicking a little floating palette is displayed above the common popup menu. I was hoping that there was a way to 1) listen for an event that is triggered when a context menu is displayed, and 2) determine the location of the context menu so that I could display a floating palette above the context menu as in Word. So far, I have not found out how to accomplish either of these things.
I suspect that there might be some focus and stage management issues with this approach generally, but I was hoping to at least get to the point where those issues were discovered.
I write a flex application. I added some custom menu items in context menu. when I compiled this code using flashplayer 10.0, it works fine and my added context menu items are shown when I Right-Click. But when I compile same code for flashPlayer 10.1, menu items that I added in context menu are not shown when I Right-Click. I am using sdk 3.5.
I am doing this; private var cm:ContextMenu = new ContextMenu(); var versionMenu:ContextMenuItem = null; var dateMenu:ContextMenuItem = null; if(model.appVersion.length > 0) { versionMenu = new ContextMenuItem(model.appVersion); [Code] .....
I have a Label in AS3 that I want to be selectable (.selectable = true) AND I want the clipboardMenu to show up on right-click ALONG with custom menu items.
If I do THIS:
var label:Label = new Label(); label.text = "test"; label.selectable = false;
[Code]....
The label IS selectable - however ONLY the clipboard menu items are present.
How can I both make the label selectable AND have a menu with my custom items + standard clipboard items?
BTW - this is with an AIR application using the 3.2 SDK.
I created a Flex application with a textArea. I'm populating the textArea's htmlText property.I have a context menu on the textArea, but I don't see how to make a different context menu when the user right clicks on a <a href...>link</a>. Can I control the context menu for a link displayed inside of the htmlText of a mx:TextArea?
var contextMenu:ContextMenu = new ContextMenu(); contextMenu.hideBuiltInItems(); var contactList : ContextMenuItem = new ContextMenuItem("Add to Existing List");
[Code]....
All coding on contactListItemRenderer.as and call to datagrid like
My Flex 3 application uses a custom cursor and has to show a customized context menu when the user performs a right click. The problem is the customized menu is shown only when the default arrow cursor is shown. When I change it to the custom cursor, the standard context menu appears instead of the customized one.
Is there a way to have both custom cursor and customized context menu in a flash application?
How i open my custom menu over right click on Text Area control, currently default menue of paste, Copy, Cut etc is opened.Please keep in mind that i want to open custom context menu over TextArea Control of Flex.
I am aware of how to reset the right-click context menu to just "settings", but when the file is opened in Flash Player directly from a computer instead of on the web, the drop-down menu in the player is still available. You can even press ctrl+enter to play. My searches just come up with solutions to the right-click menu, and I have a client who wants me to get rid of this menu for a game I've already made.
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].....
does anyone know how to make right clicking work in as3?i don't want a context menu to appear, i just want it to work as an EventListener for MovieClips.For example, imagine that RIGHT_CLICK is a MouseEvent, it would look like this:[code]i know the code wont end up looking like this, but does anyone know how to pull off this same idea using a right click?[code]
i Code: mport flash.display.*; import flash.external.ExternalInterface;
[code]...
then where do i tell it that i want to have the MouseEvent EventListener on my movieclip labeled "mastButton" ?(obviously i know its not really a MouseEvent but do u know what i mean? like how to i link this right click event TO a particular movieclip?)