BABY&RIA
ria,how cool..
::
首页
::
联系
::
订阅
::
管理
16 Posts :: 0 Stories :: 22 Comments :: 0 Trackbacks
公告
昵称:
小川
园龄:
3年7个月
粉丝:
1
关注:
0
搜索
我的标签
ORM
(3)
ActionScript
(2)
Flash
(2)
AIR
(2)
note
(1)
lib
(1)
library
(1)
aslib
(1)
Remoting
(1)
python
(1)
更多
随笔分类
(16)
ActionScript 3(7)
Design Pattern(1)
Life(3)
ORM(3)
Python(1)
Remoting(1)
.net好友
Construction
as好友
G&S Blog
my收藏
架构设计
架构设计
积分与排名
积分 - 6608
排名 - 11323
最新评论
评论排行榜
推荐排行榜
flash右键自定义“动态”菜单
在 ContextMenuEvent.Menu_SELECT
事件(注意
不是Menu_ITEM_SELECT
事件)触发时,
可以改变 MenuItem 的属性
这样菜单就可以灵活的变化了
code:
CustomContextMenu
import
flash.ui.ContextMenu;
import
flash.ui.ContextMenuBuiltInItems;
import
flash.ui.ContextMenuItem;
import
flash.events.ContextMenuEvent;
import
flash.text.TextField;
var tf:TextField
=
new
TextField();
tf.text
=
""
;
tf.x
=
stage.stageWidth
/
2
-
20
;
tf.y
=
stage.stageHeight
/
2
-
20
;
addChild(tf);
var cm:ContextMenu
=
new
ContextMenu();
cm.hideBuiltInItems();
var cmi:ContextMenuItem
=
new
ContextMenuItem(
"
true
"
);
cm.customItems.push(cmi);
this
.contextMenu
=
cm;
cm.addEventListener(ContextMenuEvent.MENU_SELECT,onSelected);
cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,onItemSelected);
function onSelected(e:ContextMenuEvent):
void
{
if
(tf.text
==
"
true
"
)
{
cmi.caption
=
"
false
"
;
}
else
{
cmi.caption
=
"
true
"
;
}
}
function onItemSelected(e:ContextMenuEvent):
void
{
tf.text
=
cmi.caption;
}
demo:
绿色通道:
好文要顶
关注我
收藏该文
与我联系
posted on 2008-07-08 22:49
小川
阅读(386)
评论(0)
编辑
收藏
注册用户登录后才能发表评论,请
登录
或
注册
,
返回博客园首页
。
首页
博问
闪存
新闻
园子
招聘
知识库
最新IT新闻
:
·
最想要的Entity Framework功能
·
专访Jeffrey Richter:Windows 8是微软的重中之重
·
《福布斯》:谷歌进军硬件产品 难撼动苹果地位
·
美国空军拟最多购买1.8万台iPad 2
·
分析称专利之争让谷歌苹果两败俱伤
»
更多新闻...
最新知识库文章
:
·
高级编程语言的发展历程
·
如何学习一门新的编程语言?
·
学习不同编程语言的重要性
·
为什么我喜欢富于表达性的编程语言
·
计算机专业的女生为什么要学编程
»
更多知识库文章...
China-pub 2011秋季教材巡展
China-Pub 计算机绝版图书按需印刷服务
Copyright @ 小川
Powered by:
.Text
and
ASP.NET
Theme by:
.NET Monster