Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 3.0 (http://www.flasher.ru/forum/forumdisplay.php?f=83)
-   -   Access of possibly undefined property weight through a reference with static type (http://www.flasher.ru/forum/showthread.php?t=115306)

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

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

Цитата:

Сообщение от sospamom (Сообщение 760307)
Что я неправильно делаю?

В первую очередь вопросы неправильно задаете.


Часовой пояс GMT +4, время: 14:59.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.