| sospamom |
26.08.2008 11:28 |
Access of possibly undefined property weight through a reference with static type
Код:
package code{
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.geom.*;
public class Document extends Sprite{
private var title:Title = new Title();
private var body:Body = new Body();
private var count:int=0;
public function Document()
{
addChild(title);
addChild(body);
body.addEventListener(Event.ADDED_TO_STAGE, addedToStageListener);
title.addEventListener(Event.ADDED_TO_STAGE, addedToStageListener2);
}
private function addedToStageListener(e:Event):void {
count++;
test();
}
private function addedToStageListener2(e:Event):void {
count++;
test();
}
private function test()
{
if (count == 2)
{
body.x = title.weight;
}
}
}
}
Выдает ошибку:
Access of possibly undefined property weight through a reference with static type code:Title
|