as屏蔽鼠标右键:
第一种:fscommand("showmenu",fasle)
第二种: Stage.showMenu=false
as自定义鼠标右键菜单:
右键菜单 = new ContextMenu();
右键菜单.hideBuiltInItems();
右键菜单.customItems.push(new ContextMenuItem('·紫风驿站1·', dj_menu0, false));
右键菜单.customItems.push(new ContextMenuItem('·紫风驿站2·', dj_menu1, false));
function dj_menu0() {
getURL('http://hi.baidu.com/zidiqingfeng', '_blank');
}
function dj_menu1() {
getURL('http://hi.baidu.com/zidiqingfeng', '_blank');
}
_root.menu = 右键菜单;
////////////////////////////////////////////////////////////////
as在场景元件上自定义鼠标右键菜单:
var my_cm = new ContextMenu();
my_cm.customItems.push(new ContextMenuItem("旋转", rotate));
my_cm.customItems.push(new ContextMenuItem("下落", drop));
my_cm.customItems.push(new ContextMenuItem("缩放", zoom));
my_cm.hideBuiltInItems();
function rotate(obj, item) {
obj.onEnterFrame = function() {
this._rotation += 15;
};
}
function drop(obj, item) {
obj.onEnterFrame = function() {
this._y = (this._y+8)%400;
};
}
function zoom(obj, item) {
obj.onEnterFrame = function() {
this._xscale = this._yscale -= 5;
if (this._xscale<=-100) {
this._xscale = this._yscale=100;
}
};
}
for (var i in _root) {
_root[i].menu = my_cm;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
·<flash> flash鼠标各键的响应代码·