ActionScript 3.0 :: Create A Custom Right Click Menu?
Mar 10, 2009
I was wondering if there's any way to create a custom right click menu like in context menu(or similar) without the "Settings" and "About Adobe Flash.." etc... options?
Ive noticed a lot of flash websites have user defined items/links added to the default flash right click settings menu. In other words when we right click on such flash websites it shows links to the designers home page or associated site etc.
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].....
Basically I have lot of text fields that are rendered dynamically, and I want the user to be able to right click on one and edit it.
Is it good practise to use the right-click bring up custom menu on a sprite. And is the method guaranteed to work accross all browsers? Do mac mice have right mouse click buttons?
[URL]
And if not, what would be a good work around. Maybe bringing up a yahoo astra message box with the two options one for left mouse click, one for right click and edit text field?
Just wondering if it is possible to show a movie clip based menu inside a Flash movie when the user "right-clicks" an item (a button or movie clip for example).
When I click simulate download my custom right click menu only appears once the movie has loaded. I have a layer called "actions" that contains this code:
Code: var myMenu:ContextMenu = new ContextMenu(); myMenu.hideBuiltInItems(); this.contextMenu = myMenu;
How can I make it so that my custom menu works while it's preloading?
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.
Make a custom preloader for the whole project, in a class, is that possible? Is that a good idea to creat a custom class for the Menu or other components like Background, etc?As I read in the book "Essential ActionScript" it's ok to make custom classes and organize everything, catching the errors in isolated form , turns it easy to manage and update..How to organize the classes?
I'm making a chatroom in actionscript, and I want to create a left click menu that pulls up some functions like (Ban, Hide, View users profile, etc..) I'd rather not do it through the right click menu.
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;
How do I create a cool effect where when I click on a menu item, the layout chages size according to the size of the content on the page.URL...How did he do it? Actionscript or just transitions?
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 ?
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:
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.
I have created a sliding menu. But that is static( the number of rows are fixed). i want to create a menu with the number of rows dynamic.I have attached the fla file here.
I'm looking to create an infinate menu BUT navigating my menu from left to right using drag rather than the position of the mouse. If there's any links or tutorials around Pleeeeese let me know.
I'm trying to create a series of scripts that will create some custom event listeners.
I have three movie clips on my stage. One is a movieclip who's sole function is to hold array's and the event listeners. A second which moves around the screen. And a third that is motionless.
The problem is that the argument I want to test (which activates the custom event) is held within a string.
What I want to know is, how do you test to see if the string argument is true?
Is it something similar to this:
var myCode:String="1<0";if(myCode){ trace('one is smaller than 0'); //Strangely apparently one IS smaller than 0!!! }
I think I'm going about this in the wrong manner, however this is the only way I can think of this working... (since I need to be able to dynamically create these events)
Does anyone know of a way to keep a menu open after clicking one of its menu items? I have a custom menu (extended the menu object) it contains a bunch of check type menu items, the requirement I am trying to fulfill is to allow the user to click multiple menu items without the menu closing, and then have the menu close when it loses focus, is this possible? If it is can someone please explain how it can be done (pref. with a small example).
Is there a way to add custom fields to the built in browser context menu using Javascript?I know flash/actionscript can do this, how are they doing it? Example: right click onand see the custom context menu.Is this possible with pure javascript or do you have to use flash?Note, I'm looking for adding to the built in browser context menu, not using custom javascript popups to mimic them.
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,
Context Menus. How can I set a custom context menu on a movieclip, so that if a different movieclip (without a custom context menu) overlaps it (on a higher layer), that when right clicked, the correct context menu comes up.
I have set a custom context menu in a .swf, and I can see it normally when previewing it on flash (Test Movie).However, when I see it on my browser, I can't see the custom options (only the reduced context menu with settings and about macromedia...)On my first frame I have an actions layer with this (context + loader):
[AS] root_cm = new ContextMenu(); root_cm.hideBuiltInItems(); root_cm.customItems.push(new ContextMenuItem("Add to Favourites", itemHandler1)) root_cm.customItems.push(new ContextMenuItem("send e-mail", itemHandler2));
I am trying to learn about Custom Components at the moment. As a task I'm hoping to create a component that I can drop on my stage beside a couple of movieclips. Then using the component inspector I would like to set one clip as a button and the other as the response. So basically, when i click on the button, it reveals the other clip. Click and reveal!