You need to compile the maps into separate SWF files then, and load those SWF files using flash.display.Loader.
There's no concept of AS files after they have been compiled. There are only SWF (and to be fair, SWC) binaries, and there is no way of evaluating/running dynamic AS3 source code at runtime. Cheers /R On Jul 18, 7:05 am, maltech <[email protected]> wrote: > Maybe if I do not use the word map it will help. Sometimes the > explanation of the problem is everything. > > I want to have a seperate .as file from my main launch .as file that > holds objects with their relative locations and materials. > > Then I need for that file to load into my main launch .as file. > > Does this clear things up? cause I am not getting much response out of > this thread. > > On Jul 17, 6:18 pm, maltech <[email protected]> wrote: > > > I have tried a lot of things, I have tried adding a view to the > > map1.as but I get an error about doing that to an object because I > > have it set to extend Object3D I have tried to make it extend sprite > > no good. And I have moved the camera around and tried adding a skybox, > > but still the screen is blank. > > > On Jul 17, 2:56 pm, Peter Kapelyan <[email protected]> wrote: > > > > Could it be the camera is in the wrong place? Maybe put something in real > > > quick to look around scene to make sure.. > > > > Didn't try your code but maybe you can trace something in function Map1 > > > also. > > > > -Pete > > > > On Fri, Jul 17, 2009 at 2:05 PM, maltech <[email protected]> wrote: > > > > > 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) > > > > -- > > > ___________________ > > > > Actionscript 3.0 Flash 3D Graphics Engine > > > > HTTP://AWAY3D.COM
