I am trying to figure out how you make files like SeaTurtleAnimated.as

By reading I thought it was the AS3exporter but it dose not seem to
make these files. I have run this with Md2, 3ds, and obj files. I am
going by this url for directions on how to used the exporter.
http://www.mail-archive.com/[email protected]/msg06218.html

I have set up my game.as file with this.

                lod = new Loader3D();
                lod = Obj.load("obj3d/rob1.obj");
                scene.addChild(lod);

                ex1 = new AS3Exporter();
                ex1.addOnExportComplete(runAsExporter);
                ex1.export(lod, "Rob1.as");

                public function runAsExporter(e:ExporterEvent)
                {

                                 trace("as3 generated: "+ e.data);
                }

This is what I get back. Is this right. It is a model of a robot not a
cube. If it is what I am supposed to get back how do you get files
like SeaTurtleAnimated.as


as3 generated: //AS3 exporter version 2.2, generated by Away3D:
http://www.away3d.com
package
{
        import away3d.containers.ObjectContainer3D;
        import away3d.containers.Scene3D;
        import away3d.core.math.*;
        import away3d.materials.*;
        import away3d.core.base.*;
        import away3d.core.utils.Init;
        import away3d.loaders.utils.*;
        import away3d.loaders.data.*;
        import flash.utils.Dictionary;
        import away3d.primitives.*;

        public class Rob1.as extends ObjectContainer3D
        {
                private var objs:Object = {};
                private var geos:Array = [];
                private var oList:Array =[];
                private var aC:Array;
                private var aV:Array;
                private var aU:Array;
                private var _scale:Number;

                public function Rob1.as(init:Object = null)
                {
                        var ini:Init = Init.parse(init);
                        _scale = ini.getNumber("scaling", 1);
                        setSource();
                        addContainers();
                        buildMeshes();
                        buildMaterials();
                        cleanUp();
                }

                private function buildMeshes():void
                {
                        var cube0:Cube = new Cube({material:null, 
height:200*_scale, depth:
200*_scale, width:200*_scale});
                        cube0.position= new Number3D(0,0,0);
                        oList.push(cube0);
                        aC[0].addChild(cube0);
                }

                private function setSource():void
                {}

                private function buildMaterials():void
                {
                }
                private function cleanUp():void
                {
                        for(var i:int = 0;i<1;++i){
                                objs["obj"+i] == null;
                        }
                        aV = null;
                        aU = null;
                }

                private function addContainers():void
                {
                        aC = [];
                                                aC.push(this);
                        var m0:MatrixAway3D = new MatrixAway3D();
                        m0.sxx = 1;
                        m0.sxy = 0;
                        m0.sxz = 0;
                        m0.tx = 0*_scale;
                        m0.syx = 0;
                        m0.syy = 1;
                        m0.syz = 0;
                        m0.ty = 0*_scale;
                        m0.szx = 0;
                        m0.szy = 0;
                        m0.szz = 1;
                        m0.tz = 0*_scale;
                        transform = m0;

                }

                public function get containers():Array
                {
                        return aC;
                }


                public function get meshes():Array
                {
                        return oList;
                }


                private function read(str:String):String
                {
                        var start:int= 0;
                        var chunk:String;
                        var end:int= 0;
                        var dec:String = "";
                        var charcount:int = str.length;
                        for(var i:int = 0;i<charcount;++i){
                                if (str.charCodeAt(i)>=44 && 
str.charCodeAt(i)<= 48 ){
                                        dec+= str.substring(i, i+1);
                                }else{
                                        start = i;
                                        chunk = "";
                                        while(str.charCodeAt(i)!=44 && 
str.charCodeAt(i)!= 45 &&
str.charCodeAt(i)!= 46 && str.charCodeAt(i)!= 47 && i<=charcount){
                                                i++;
                                        }
                                        chunk = 
""+parseInt("0x"+str.substring(start, i), 16 );
                                        dec+= chunk;
                                        i--;
                                }
                        }
                        return dec;
                }

        }
}

Reply via email to