Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 3.0 (http://www.flasher.ru/forum/forumdisplay.php?f=83)
-   -   haXe, не работает rotationX,Y,Z (http://www.flasher.ru/forum/showthread.php?t=142516)

drnet_ua 23.07.2010 12:18

haXe, не работает rotationX,Y,Z
 
код АС3 работает, а haXe нет(не вращается box) :(((((

в чем грабли?


AS3:
Код AS3:

package 
{
        import flash.display.MovieClip;
        import flash.display.Sprite;
        import flash.events.Event;
 
        public class Main extends Sprite
        {
                private var box:MovieClip;
 
                private function draw():void {
 
                        with (box.graphics) {
                                beginFill(0xffff00);
                                lineStyle(3, 0x000000, 1);
                                drawRect( -100, -100, 200, 200);
                                endFill();
                        }
                }
 
                private function RotateBox(e:Event):void {
                        box.rotationX++;
                        box.rotationY++;
                        box.rotationZ++;
                }
 
                public function Main():void
                {
                        if (stage) init();
                        else addEventListener(Event.ADDED_TO_STAGE, init);
                }
 
                private function init(e:Event = null):void
                {
                        removeEventListener(Event.ADDED_TO_STAGE, init);
                        // entry point
                        box = new MovieClip();
                        draw();
                        stage.addChild(box);
                        box.x = stage.stageWidth / 2;
                        box.y = stage.stageHeight / 2;
                        addEventListener(Event.ENTER_FRAME, RotateBox);
 
                }
 
        }
 
}

haXe:
Код AS3:

package ;
 
import flash.display.MovieClip;
import flash.events.Event;
import flash.Lib;
 
class Main
{
        private var box:MovieClip;
 
                private function draw():Void {
 
 
                                box.graphics.beginFill(0xffff00);
                                box.graphics.lineStyle(3, 0x000000, 1);
                                box.graphics.drawRect( -100, -100, 200, 200);
                                box.graphics.endFill();
 
                }
 
                private function RotateBox(e:Event):Void {
                        box.rotationX++;
                        box.rotationY++;
                        box.rotationZ++;
                }
 
                public function new():Void {
 
                        box = new MovieClip();
                        draw();
                        Lib.current.addChild(box);
                        box.x = Lib.current.stage.stageWidth / 2;
                        box.y = Lib.current.stage.stageHeight / 2;
                        Lib.current.addEventListener(Event.ENTER_FRAME, RotateBox);
 
                }
 
        static function main()
        {
                new Main();
        }
 
}



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

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