我知道網上有一百萬個關於AS3編譯器錯誤1120: Access of undefined property <property>
的問題,但這種情況很奇怪。Flex編譯器錯誤1120
我正在剝皮Flex 4.6中的<s:Application>
組件,並且我在皮膚MXML文件中。該線super.addEventListener(Event.ADDED_TO_STAGE, positionObjects);
給我的問題說:1120: Access of undefined property positionObjects
。但positionObjects
在它下面聲明。任何想法有什麼不對?
<fx:Script>
<![CDATA[
/**
* @private
*/
override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number) : void
{
bgRectFill.color = getStyle('backgroundColor');
bgRectFill.alpha = getStyle('backgroundAlpha');
super.updateDisplayList(unscaledWidth, unscaledHeight);
}
//Listen for when objects are added to the stage, before positioning them
[Bindable]
private var logoX:Number = 0;
super.addEventListener(Event.ADDED_TO_STAGE, positionObjects);
private function positionObjects(e:Event):void {
this.logoX = stage.stageWidth/3;
}
]]>
</fx:Script>
謝謝你的時間。
是的,謝謝。我剛纔幾秒鐘就回答了我自己的問題。 +1 – 2012-07-15 00:25:02