PDA

Просмотр полной версии : Access of possibly undefined property weight through a reference with static type


sospamom
26.08.2008, 11:28
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

BlooDHounD
26.08.2008, 12:05
гениально. у меня бы тоже вывел.

sospamom
26.08.2008, 12:15
Что я неправильно делаю?

wvxvw
26.08.2008, 12:53
А что такое weight / Title / Body? =/

etc
26.08.2008, 20:08
Что я неправильно делаю?
В первую очередь вопросы неправильно задаете.