为什么UIComponent在界面上什么都不显示呢?

ljm10 2012-10-16 11:44:53
定义了UIComponent
<mx:UIComponent id="UI" x="0" y="310" width="320" height="100" >
</mx:UIComponent>

添加组件到UIComponent
menuMask = new Sprite();
menuMask.width = UI.width;
menuMask.height = UI.height;
var g:Graphics = menuMask.graphics;
g.beginFill(0, 0);
g.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
g.endFill();
UI.addChild(menuMask);

theMenu = new Sprite();
g = theMenu.graphics;
g.lineStyle(2, 0x666666);
g.moveTo(0, 0);
g.lineTo(stage.stageWidth, 0);

var labels:Array = new Array("delete", "settings", "about", "close");

var item_width:int = stage.stageWidth / labels.length;

var item:IconButton;
for ( var i:uint = 0, len:uint = labels.length; i < len; i++)
{
var s:String = labels[i];
item = new IconButton(s, this[s + "_ico"]);
item.name = s;
item.setSize(item_width, MENU_HEIGHT-1);
item.x = i * item_width;
item.y = 1;
theMenu.addChild(item);
}

UI.addChild(theMenu);
为什么界面什么都不显示
...全文
95 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

4,328

社区成员

发帖
与我相关
我的任务
社区描述
多媒体/设计 Flex
社区管理员
  • Flex
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧