自定義Flex右鍵選單

2021-09-02 01:20:37 字數 1255 閱讀 7480

1.右鍵專案設定flex編譯器的引數如下:

其實flash player從11.版本就支援自定義右鍵選單了。

2.重新編譯flex專案或關閉專案後重新開啟,錯誤解除。

3.測試**如下:

<?xml version="1.0" encoding="utf-8"?>

xmlns:s="library:"

xmlns:mx="library:"

minwidth="955" minheight="600"

import mx.controls.alert;

import mx.controls.menu;

import mx.events.flexevent;

import mx.events.menuevent;

this.addeventlistener(mouseevent.right_click,rightclickhandler);

}private var mymenu:menu = null ;

protected function rightclickhandler(event:mouseevent):void,,];

mymenu = menu.createmenu(this, menudata, false);

mymenu.labelfield = "label" ;

mymenu.addeventlistener(menuevent.item_click,menuitemclickhandler);

mymenu.addeventlistener(mouseevent.roll_out,menurollouthandler);

}//隱藏掉上乙個右鍵選單

mymenu.hide() ;

mymenu.show(event.stagex,event.stagey);

}protected function menuitemclickhandler(event:menuevent):void

/*** 滑鼠移出後隱藏右鍵選單

*/protected function menurollouthandler(event:mouseevent):void

]]>

效果如下:

Flex自定義右鍵選單具體實現

本篇部落格主要說明的是flex中遮蔽郵件選單並且自定義選單功能。1 自定義右鍵選單註冊類 public class rightclickmanager static public function regist boolean end if return true static private fu...

自定義右鍵選單

禁止系統右鍵選單 document.oncontextmenu function 獲取滑鼠藍色框選中的內容 document.getselection tostring 火狐不能得到文字框內的內容 示例 utf 8 title ulli li hover style head aaaa rows 4...

windows 自定義右鍵選單

引用 1.組合鍵win r,輸入regedit,回車 開啟登錄檔編輯器 2.找到目錄中 hkey classes root directory background shell 對其右鍵,新建乙個項 新建資料夾 並命名為 stikynot 你也可以將此資料夾命名為 開啟便箋 這個資料夾的名稱就是新建...