0
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

コードの最初の例を使用すると、エラーは発生しませんが、backgroundColor はまだ適用されません。styleNameうまく適用されます。backgroundColor を設定できない理由を教えてください。

4

1 に答える 1