0 Replies Latest reply on Apr 19, 2006 7:21 AM by flasher-8

    publish to version 8 error ?

    flasher-8
      i use this code

      /////////////////////////////////////////////////////////////////
      Camera=function(X,Y,Z,focalLength){
      this.fL=focalLength;
      this.X=X;
      this.Y=Y;
      this.Z=Z;
      }
      Camera.prototype.Move=function(X,Y,Z){
      this.X+=X;
      this.Y+=Y;
      this.Z+=Z;
      this.engine.Render();
      }
      Engine3D=function(Camera,Centerx,Centery){
      this.camera=Camera;
      this.camera.engine=this;
      this.vertexBuffer = _root.createEmptyMovieClip("3Dcontainer"+(containerdepth++),containerdepth);
      this.vertexBuffer._x=Centerx;
      this.vertexBuffer._y=Centery;
      this.depth=0;
      }
      Engine3D.prototype.Render=function(){
      for(i in this.vertexBuffer){
      this.vertexBuffer .Draw();
      }
      }
      Engine3D.prototype.Attach3DPoint=function(X,Y,Z){
      this.depth++;
      var mc=this.vertexBuffer.attachMovie("point","point"+this.depth,this.depth);
      mc.parentEngine=this;
      mc.X=X;
      mc.Y=Y;
      mc.Z=Z;
      mc.Draw();
      return mc;
      }
      MovieClip.prototype.Draw=function(){
      var focalRatio=this.parentEngine.camera.fL/(this.parentEngine.camera.fL+(this.Z-this.parentEn gine.camera.z))
      this._x=focalRatio*(this.parentEngine.camera.X-this.X);
      this._y=focalRatio*(this.parentEngine.camera.Y-this.Y);
      this.swapDepths(10000-this.Z);
      this._xscale=this._yscale=this._alpha=focalRatio*100;
      }
      Camera1 = new Camera(0,0,-20,70);
      Engine1=new Engine3D(Camera1,150,150);


      Radius = 1;
      Count=5;
      OutwardVelocity =.1
      RotationalVelocity =.01;
      UpwardVelocity=3;
      _root.createEmptyMovieClip("line",-1);
      for(var n = 0;n<Count;n++){
      var mc = Engine1.attach3DPoint(0,0,0);
      mc.T=n/Count*Math.PI*2;

      mc.a=1+Math.random()*5;
      mc.b=1+Math.random()*5;
      mc.c=1+Math.random()*5;

      mc.R=50;
      mc.line=line.createEmptyMovieClip("line"+n,n+1);
      mc.line.lineStyle(1,0,100);
      mc.line.moveTo(mc.parentEngine.vertexBuffer._x,mc.parentEngine.vertexBuffer._y);
      mc.onEnterFrame=function(){
      this.T+=RotationalVelocity;
      this.X=this.R*Math.cos(this.T*this.a)*Math.sin(this.T);
      this.Z=this.R*Math.sin(this.T*this.b)*Math.sin(this.T);
      this.Y=this.R*Math.sin(this.T*this.c)*Math.sin(this.T);
      }
      }
      onEnterFrame=function(){
      Engine1.Render();
      }

      ////////////////////////////////////////////////////////////////

      it works correctly on version 6.0 AS1.0
      Please tell me why?