百度首页 | 百度空间
 
查看文章
 
·<flash>·as屏蔽鼠标右键、as自定义鼠标右键菜单
2008年06月05日 星期四 11:30

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鼠标各键的响应代码·


类别:<flash> | 添加到搜藏 | 浏览() | 评论 (1)
 
最近读者:
 
网友评论:
1
2008年06月05日 星期四 12:25
~~~~
 
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码:
 

     

©2008 Baidu