开发者

Flex 3 UIComponent width property not working

I have a flex 3 application in which I draw my own UI. It is a player-style app, so it has a bar that fills as the media plays. I do this with this code:

bgRect=new UIComponent();
bgRect.graphics.lineStyle(0);
bgRect.graphics.beginFill(0xFFFFFF,1);
bgRect.graphics.drawRect(0,0,399,20);
bgRect.graphics.endFill();
bgRect.addEventListener(MouseEvent.MOUSE_DOWN,mouseDown);
bgRect.addEventListener(MouseEvent.MOUSE_UP,mouseUp);
bgRect.addEventLi开发者_如何学Gostener(MouseEvent.MOUSE_MOVE,mouseMove);
mainCanvas.addChild(bgRect);
leftRect=new UIComponent();
leftRect.graphics.beginFill(0x999999,1);
leftRect.graphics.drawRect(0,1,20,19);
leftRect.graphics.endFill();
bgRect.addChild(leftRect);

I am getting notificataions for clicks, but when i try to change the UIComponent's width with this code:

var position:Number = event.stageX;
leftRect.width = new Number(position);

nothing happens.

Any ideas?


I am not sure but may be a call to something like 'updateDisplaylist/validateDisplayList' will solve the issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜