-
Right Click menu in as3 !!!
hey guys how can i edit this code in order to be working in AS3 ????? i mean what do i need to change and with what ????
Code:
stop();
function deadClick () {
}
function gotoMySite () {
getURL("http://www.google.com", "_blank");
}
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var copyrightNotice:ContextMenuItem = new ContextMenuItem("© 2006 KPro Digital Media", deadClick);
var mySiteLink:ContextMenuItem = new ContextMenuItem("KPro Tutorial Center", gotoMySite);
copyrightNotice.separatorBefore = true;
myMenu.customItems.push(mySiteLink, copyrightNotice);
_root.menu = myMenu;
Last edited by lambrospower; 07-30-2007 at 09:13 AM.
-
hey guys i tried to make it AS3 and i don't find any error myself..and it even agrees with the livedocs..but it doesn't work when testing it....does anyone know the reason ??????
please help me !!!!!
stop();
function deadClick () {
}
function gotoMySite () {
var mySite:URLRequest = new URLRequest("http://www.webng.com/volleyman/");
navigateToURL(mySite);
}
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var copyrightNotice:ContextMenuItem = new ContextMenuItem("© 2007 V-Men");
var mySiteLink:ContextMenuItem = new ContextMenuItem("VolleyMen Homepage");
copyrightNotice.separatorBefore = true;
myMenu.customItems.push(mySiteLink, copyrightNotice);
-
One thing you need to do is import your classes.
Code:
import flash.net.URLRequest;
import flash.ui.ContextMenu;
stop();
function deadClick () {
}
function gotoMySite () {
var mySite:URLRequest = new URLRequest("http://www.webng.com/volleyman/");
navigateToURL(mySite);
}
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var copyrightNotice:ContextMenuItem = new ContextMenuItem("© 2007 V-Men");
var mySiteLink:ContextMenuItem = new ContextMenuItem("VolleyMen Homepage");
copyrightNotice.separatorBefore = true;
myMenu.customItems.push(mySiteLink, copyrightNotice);
The flash ide would not immediately throw an error for not importing those classes but it would not work at runtime. You must import any class that you use.
-
well i treid it but it doesn't work either !!! damn i can't find any code problem.......please anyone that knows
-
you just need to apply the context menu you made... i.e
this.contextMenu = myMenu;
-
Thanks guys, I now understand how to do this now
-
I cant get the url request working.
A help wuld be appreciated.
-
Thanks for all your help. Here is a solution to the url request issue:
Code:
// update context menu:
// no optional built-in features as play creates a playback reader error
// new copyright and home page features
var myContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();
var copyrightNotice:ContextMenuItem = new ContextMenuItem("© Copyright 2009, LectureMaker.com");
var mySiteLink:ContextMenuItem = new ContextMenuItem("LectureMaker home page");
copyrightNotice.separatorBefore = true;
myContextMenu.customItems.push(mySiteLink, copyrightNotice);
mySiteLink.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,function() { navigateToURL(new URLRequest("http://www.LectureMaker.com"), "_blank");});
this.contextMenu = myContextMenu;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|