决定要把我遇到的很神奇的问题都写出来,一是求高手解答,二是有可能会有人遇到一样的问题,算是利人利己吧,嘿嘿。
1.今天用AS2 写个右键菜单(我新学AS2),发现一个问题,觉得很神奇
先上代码吧:
var my_cm:ContextMenu=new ContextMenu();
my_cm.hideBuiltInItems ();
//my_cm.customItems.push(new ContextMenuItem("1",setLink));
my_cm.customItems.push(new ContextMenuItem("2",function(){}));
my_cm.customItems.push(new ContextMenuItem("3",test));
my_cm.customItems.push(new ContextMenuItem("4",setLink));
this.menu=my_cm;
function setLink(){
getURL("http://www.baidu.com","_blank");
}
function test(){
trace("123");
}
这是在一个空的flash的第一帧里写的 ,我发现当菜单名用“1”的时候,它不能被显示,而用其他数字则可以,我只试到了5,当然如果有兴趣可以拷下这段代码试到91236,我相信应该不会出现第二个数字的吧,我很想知道为什么,然后再一次单独展示疑惑的那句代码//my_cm.customItems.push(new ContextMenuItem("1",setLink));
谢谢各位高手的回答