[color=red]如何为Group设置背景色?[/color]
利用s:Rect,实例代码如下:
[color=red]如何遍历BorderContainer的child element?[/color]
[color=red]Container内部的Component的坐标是基于其Container的左上角坐标进行偏移的
[/color]
代码片段如下:
上边的代码中,如果parent左上角的坐标为(200, 200),则child的左上角坐标为(400, 400)
[color=red]SkinableContainer默认是空白的,没有绘图东西的部分不会响应鼠标事件,而Group则没有这种问题[/color]
利用s:Rect,实例代码如下:
<s:Group width="100%" height="100%" >
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor color="0xffff00"/>
</s:fill>
</s:Rect>
</s:Group>
[color=red]如何遍历BorderContainer的child element?[/color]
for (var i:uint = 0; i < container.numElements; i++)
{
var graphic:UIComponent = container.getElementAt(i) as UIComponent;
}
[color=red]Container内部的Component的坐标是基于其Container的左上角坐标进行偏移的
[/color]
代码片段如下:
<s:Group id= "parent"x="200" y="200">
<s:Group id= "child" x="200" y="200"/>
</s:Group>
上边的代码中,如果parent左上角的坐标为(200, 200),则child的左上角坐标为(400, 400)
[color=red]SkinableContainer默认是空白的,没有绘图东西的部分不会响应鼠标事件,而Group则没有这种问题[/color]