【发布时间】:2013-05-29 09:52:10
【问题描述】:
var newHBox:VBox = new VBox();
newHBox['width'] = 20;
newHBox['height'] = 30;
newHBox['backgroundColor'] = "#FF0000";
container.addChild(newHBox);
或
var newHBox:VBox = new VBox();
newHBox.width = 20;
newHBox.height = 30;
newHBox.backgroundColor = "#FF0000";
container.addChild(newHBox);
我不明白为什么我不能设置backgroundColor 属性,我得到一个错误:
access of possibly undefined property through a reference with static type mx.containers.VBox
如果我使用第一个代码示例,那么没有错误,但背景颜色仍然不适用,styleName 应用良好,你能告诉我为什么背景颜色不能设置吗?
【问题讨论】:
-
背景颜色是一个继承的属性。但看看这个网站可能会有所帮助dickbaldwin.com/actionScript/ActionScript0130/…
标签: apache-flex actionscript mxml