Trying to see what I missed here.

The Map1.as

        import away3d.core.base.Object3D;
        import away3d.materials.BitmapFileMaterial;
        import away3d.primitives.*;

        public class Map1 extends Object3D
        {
                //load skins for planets
                [embed(source="sunmap.jpg")]
                private var sunskin:BitmapFileMaterial;

                private var sun:Sphere;

                public function Map1()
                {

                sunskin = new BitmapFileMaterial("sunmap.jpg");
                sun = new Sphere({material:sunskin, radius:6955, segmentsH:16,
segmentsW:16});

                }
       }
}

The main game file

        import away3d.cameras.Camera3D;
        import away3d.containers.View3D;

        import flash.display.Sprite;

        [SWF(frameRate="80", backgroundColor="#FFFFFF")]
        public class Game extends Sprite
        {
                private var map:Map1;
                private var view:View3D;
                private var cam:Camera3D;

                public function Game()
                {
                        view = new View3D();
                        cam = new Camera3D();
                        addChild(view);
                        view.camera = cam;
                        cam.z = -7000;

                        map = new Map1();
                        view.scene.addChild(map);
                        view.render();
                }
        }

You may wonder why, the reason is after the code gets bigger I want
the game to be easier to manage.
seperating the maps from the main game code would allow for easy
updating of the maps, think component based games.

I am getting nothing on screen when I do it this way, any help
appreciated.

(btw no errors, thats what is annoying, its easier when there is an
error cause I have a place to fix something)

Reply via email to