flash右键代码

flash右键代码,第1张

在FLASH第一帧放入如下代码:

var CustomMenu:ContextMenu = new ContextMenu()

CustomMenu.hideBuiltInItems()

var CMI001:ContextMenuItem = new ContextMenuItem("==== =轻轻松松学五笔= ====", Fuc_Menu1)

var CMI002:ContextMenuItem = new ContextMenuItem("+- 切换到上一页(←键) -+", Fuc_Menu2)

var CMI003:ContextMenuItem = new ContextMenuItem("+- 1.认识英文字母 -+", Fuc_Menu3)

var CMI004:ContextMenuItem = new ContextMenuItem("+- 2.打字指法 -+", Fuc_Menu4)

var CMI005:ContextMenuItem = new ContextMenuItem("+- 3.关于五笔输入法 -+", Fuc_Menu5)

var CMI006:ContextMenuItem = new ContextMenuItem("+- 4.五笔拆字方法 -+", Fuc_Menu6)

var CMI007:ContextMenuItem = new ContextMenuItem("+- 5.五笔输入规则 -+", Fuc_Menu7)

var CMI008:ContextMenuItem = new ContextMenuItem("+- 6.字根表助记歌详解 -+", Fuc_Menu8)

var CMI009:ContextMenuItem = new ContextMenuItem("+- 7.学习五笔经验总结 -+", Fuc_Menu9)

var CMI010:ContextMenuItem = new ContextMenuItem("+- 8.后 记 -+", Fuc_Menu10)

var CMI011:ContextMenuItem = new ContextMenuItem("+- 9.轻松一刻-双低金句 -+", Fuc_Menu11)

var CMI012:ContextMenuItem = new ContextMenuItem("+- 切换到下一页(→键) -+", Fuc_Menu12)

var CMI013:ContextMenuItem = new ContextMenuItem("广东科学技术职业学院学生论坛",

Fuc_Menu13)

var CMI014:ContextMenuItem = new ContextMenuItem("一些事一些情官方网站", Fuc_Menu14)

var CMI015:ContextMenuItem = new ContextMenuItem("====小鸟精神 服务社群====", Fuc_Menu15)

CMI002.separatorBefore = true

CMI003.separatorBefore = true

CMI010.separatorBefore = true

CMI013.separatorBefore = true

CMI015.separatorBefore = true

CMI001.enabled = false

CMI002.enabled = false

CMI015.enabled = false

CustomMenu.customItems.push(CMI001)

CustomMenu.customItems.push(CMI002)

CustomMenu.customItems.push(CMI012)

CustomMenu.customItems.push(CMI003)

CustomMenu.customItems.push(CMI004)

CustomMenu.customItems.push(CMI005)

CustomMenu.customItems.push(CMI006)

CustomMenu.customItems.push(CMI007)

CustomMenu.customItems.push(CMI008)

CustomMenu.customItems.push(CMI009)

CustomMenu.customItems.push(CMI010)

CustomMenu.customItems.push(CMI011)

CustomMenu.customItems.push(CMI013)

CustomMenu.customItems.push(CMI014)

CustomMenu.customItems.push(CMI015)

function Fuc_Menu1() {

//

}

function Fuc_Menu2() {

if (_root._currentframe>3) {

_root.prevFrame()

CMI012.enabled = true

} else if (_root._currentframe == 3) {

_root.prevFrame()

CMI002.enabled = false

}

}

function Fuc_Menu3() {

_root.gotoAndStop(3)

}

function Fuc_Menu4() {

_root.gotoAndStop(4)

}

function Fuc_Menu5() {

_root.gotoAndStop(7)

}

function Fuc_Menu6() {

_root.gotoAndStop(9)

}

function Fuc_Menu7() {

_root.gotoAndStop(11)

}

function Fuc_Menu8() {

_root.gotoAndStop(15)

}

function Fuc_Menu9() {

_root.gotoAndStop(18)

}

function Fuc_Menu10() {

_root.gotoAndStop(19)

}

function Fuc_Menu11() {

_root.gotoAndStop(21)

}

function Fuc_Menu12() {

if (_root._currentframe<21) {

_root.nextFrame()

CMI002.enabled = true

} else if (_root._currentframe == 21) {

_root.nextFrame()

CMI012.enabled = false

}

}

function Fuc_Menu13() {

getURL("http://bbs.kgbbs.cn", "_blank")

}

function Fuc_Menu14() {

getURL("http://www.loveq.cn", "_blank")

}

function Fuc_Menu15() {

//

}

this.menu = CustomMenu

给个示例你

详细解释建议你在FLASH8中按F1

ActionScript 2.0 语言参考 ActionScript 类 ContextMenu

中查看相关示例及解释

还有 FLASH允许添加的菜单项数不超过15项

//创建自定义菜单

var CustomMenu:ContextMenu = new ContextMenu()

CustomMenu.hideBuiltInItems()

var CMI001:ContextMenuItem = new ContextMenuItem("==== =轻轻松松学五笔= ====", Fuc_Menu1)

var CMI002:ContextMenuItem = new ContextMenuItem("+- 切换到上一页(←键) -+", Fuc_Menu2)

var CMI003:ContextMenuItem = new ContextMenuItem("+- 1.认识英文字母 -+", Fuc_Menu3)

var CMI004:ContextMenuItem = new ContextMenuItem("+- 2.打字指法 -+", Fuc_Menu4)

var CMI005:ContextMenuItem = new ContextMenuItem("+- 3.关于五笔输入法 -+", Fuc_Menu5)

var CMI006:ContextMenuItem = new ContextMenuItem("+- 4.五笔拆字方法 -+", Fuc_Menu6)

var CMI007:ContextMenuItem = new ContextMenuItem("+- 5.五笔输入规则 -+", Fuc_Menu7)

var CMI008:ContextMenuItem = new ContextMenuItem("+- 6.字根表助记歌详解 -+", Fuc_Menu8)

var CMI009:ContextMenuItem = new ContextMenuItem("+- 7.学习五笔经验总结 -+", Fuc_Menu9)

var CMI010:ContextMenuItem = new ContextMenuItem("+- 8.后 记 -+", Fuc_Menu10)

var CMI011:ContextMenuItem = new ContextMenuItem("+- 9.轻松一刻-双低金句 -+", Fuc_Menu11)

var CMI012:ContextMenuItem = new ContextMenuItem("+- 切换到下一页(→键) -+", Fuc_Menu12)

var CMI013:ContextMenuItem = new ContextMenuItem("广东科学技术职业学院学生论坛", Fuc_Menu13)

var CMI014:ContextMenuItem = new ContextMenuItem("一些事一些情官方网站", Fuc_Menu14)

var CMI015:ContextMenuItem = new ContextMenuItem("====小鸟精神 服务社群====", Fuc_Menu15)

CMI002.separatorBefore = true

CMI003.separatorBefore = true

CMI010.separatorBefore = true

CMI013.separatorBefore = true

CMI015.separatorBefore = true

CMI001.enabled = false

CMI002.enabled = false

CMI015.enabled = false

CustomMenu.customItems.push(CMI001)

CustomMenu.customItems.push(CMI002)

CustomMenu.customItems.push(CMI012)

CustomMenu.customItems.push(CMI003)

CustomMenu.customItems.push(CMI004)

CustomMenu.customItems.push(CMI005)

CustomMenu.customItems.push(CMI006)

CustomMenu.customItems.push(CMI007)

CustomMenu.customItems.push(CMI008)

CustomMenu.customItems.push(CMI009)

CustomMenu.customItems.push(CMI010)

CustomMenu.customItems.push(CMI011)

CustomMenu.customItems.push(CMI013)

CustomMenu.customItems.push(CMI014)

CustomMenu.customItems.push(CMI015)

function Fuc_Menu1() {

//

}

function Fuc_Menu2() {

if (_root._currentframe3) {

_root.prevFrame()

CMI012.enabled = true

} else if (_root._currentframe == 3) {

_root.prevFrame()

CMI002.enabled = false

}

}

function Fuc_Menu3() {

_root.gotoAndStop(3)

}

function Fuc_Menu4() {

_root.gotoAndStop(4)

}

function Fuc_Menu5() {

_root.gotoAndStop(7)

}

function Fuc_Menu6() {

_root.gotoAndStop(9)

}

function Fuc_Menu7() {

_root.gotoAndStop(11)

}

function Fuc_Menu8() {

_root.gotoAndStop(15)

}

function Fuc_Menu9() {

_root.gotoAndStop(18)

}

function Fuc_Menu10() {

_root.gotoAndStop(19)

}

function Fuc_Menu11() {

_root.gotoAndStop(21)

}

function Fuc_Menu12() {

if (_root._currentframe21) {

_root.nextFrame()

CMI002.enabled = true

} else if (_root._currentframe == 21) {

_root.nextFrame()

CMI012.enabled = false

}

}

function Fuc_Menu13() {

getURL("", "_blank")

}

function Fuc_Menu14() {

getURL("", "_blank")

}

function Fuc_Menu15() {

//

}

this.menu = CustomMenu

2.创建自定义菜单的步骤是先实例化菜单容器类

ContextMenu

然后再实例化 子菜单类 ContextMenuItem

将子菜单添加到菜单容器中

然后还要为各子菜单编写处理函数 下面的代码就是了 自己慢慢分析一下吧

==============

给个示例你

详细解释建议你在FLASH8中按F1

ActionScript 2.0 语言参考 >ActionScript 类 >ContextMenu

中查看相关示例及解释

还有 FLASH允许添加的菜单项数不超过15项

//创建自定义菜单

var CustomMenu:ContextMenu = new ContextMenu()

CustomMenu.hideBuiltInItems()

var CMI001:ContextMenuItem = new ContextMenuItem("==== =轻轻松松学五笔= ====", Fuc_Menu1)

var CMI002:ContextMenuItem = new ContextMenuItem("+- 切换到上一页(←键) -+", Fuc_Menu2)

var CMI003:ContextMenuItem = new ContextMenuItem("+- 1.认识英文字母 -+", Fuc_Menu3)

var CMI004:ContextMenuItem = new ContextMenuItem("+- 2.打字指法 -+", Fuc_Menu4)

var CMI005:ContextMenuItem = new ContextMenuItem("+- 3.关于五笔输入法 -+", Fuc_Menu5)

var CMI006:ContextMenuItem = new ContextMenuItem("+- 4.五笔拆字方法 -+", Fuc_Menu6)

var CMI007:ContextMenuItem = new ContextMenuItem("+- 5.五笔输入规则 -+", Fuc_Menu7)

var CMI008:ContextMenuItem = new ContextMenuItem("+- 6.字根表助记歌详解 -+", Fuc_Menu8)

var CMI009:ContextMenuItem = new ContextMenuItem("+- 7.学习五笔经验总结 -+", Fuc_Menu9)

var CMI010:ContextMenuItem = new ContextMenuItem("+- 8.后 记 -+", Fuc_Menu10)

var CMI011:ContextMenuItem = new ContextMenuItem("+- 9.轻松一刻-双低金句 -+", Fuc_Menu11)

var CMI012:ContextMenuItem = new ContextMenuItem("+- 切换到下一页(→键) -+", Fuc_Menu12)

var CMI013:ContextMenuItem = new ContextMenuItem("广东科学技术职业学院学生论坛", Fuc_Menu13)

var CMI014:ContextMenuItem = new ContextMenuItem("一些事一些情官方网站", Fuc_Menu14)

var CMI015:ContextMenuItem = new ContextMenuItem("====小鸟精神 服务社群====", Fuc_Menu15)

CMI002.separatorBefore = true

CMI003.separatorBefore = true

CMI010.separatorBefore = true

CMI013.separatorBefore = true

CMI015.separatorBefore = true

CMI001.enabled = false

CMI002.enabled = false

CMI015.enabled = false

CustomMenu.customItems.push(CMI001)

CustomMenu.customItems.push(CMI002)

CustomMenu.customItems.push(CMI012)

CustomMenu.customItems.push(CMI003)

CustomMenu.customItems.push(CMI004)

CustomMenu.customItems.push(CMI005)

CustomMenu.customItems.push(CMI006)

CustomMenu.customItems.push(CMI007)

CustomMenu.customItems.push(CMI008)

CustomMenu.customItems.push(CMI009)

CustomMenu.customItems.push(CMI010)

CustomMenu.customItems.push(CMI011)

CustomMenu.customItems.push(CMI013)

CustomMenu.customItems.push(CMI014)

CustomMenu.customItems.push(CMI015)

function Fuc_Menu1() {

//

}

function Fuc_Menu2() {

if (_root._currentframe>3) {

_root.prevFrame()

CMI012.enabled = true

} else if (_root._currentframe == 3) {

_root.prevFrame()

CMI002.enabled = false

}

}

function Fuc_Menu3() {

_root.gotoAndStop(3)

}

function Fuc_Menu4() {

_root.gotoAndStop(4)

}

function Fuc_Menu5() {

_root.gotoAndStop(7)

}

function Fuc_Menu6() {

_root.gotoAndStop(9)

}

function Fuc_Menu7() {

_root.gotoAndStop(11)

}

function Fuc_Menu8() {

_root.gotoAndStop(15)

}

function Fuc_Menu9() {

_root.gotoAndStop(18)

}

function Fuc_Menu10() {

_root.gotoAndStop(19)

}

function Fuc_Menu11() {

_root.gotoAndStop(21)

}

function Fuc_Menu12() {

if (_root._currentframe<21) {

_root.nextFrame()

CMI002.enabled = true

} else if (_root._currentframe == 21) {

_root.nextFrame()

CMI012.enabled = false

}

}

function Fuc_Menu13() {

getURL("http://bbs.kgbbs.cn", "_blank")

}

function Fuc_Menu14() {

getURL("http://www.loveq.cn", "_blank")

}

function Fuc_Menu15() {

//

}

this.menu = CustomMenu


欢迎分享,转载请注明来源:夏雨云

原文地址:https://www.xiayuyun.com/zonghe/365623.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-11
下一篇2023-05-11

发表评论

登录后才能评论

评论列表(0条)

    保存