2 Replies Latest reply on Mar 6, 2009 5:25 PM by Bj_flash

    3D movement in AS 2.0

    izdo89
      I'm working on a project and I want to make a page that has 8 mcs in a circle. However, the circle is 3D. Some mcs are close, some are far. When a viewer clicks on an mc, the circle rotates. I've gotten ahold of some code and tried to implement it and it has not worked. Does anyone have any advice?

      Something similar to the movement on this page:
      http://www.templatehelp.com/preset/pr_preview.php?i=22810&pr_code=Q26Vn38V68vBY9CIBUNra62h ZU0fNk
        • 1. Re: 3D movement in AS 2.0
          Bj_flash Level 1
          Try using this as a starting point. attach this code to a movieclip and watch it move, play with the numbers and there you go. Much of this code 'borrowed' from a bit-101.com tutorial. Thanks Keith!
          • 2. Re: 3D movement in AS 2.0
            Bj_flash Level 1
            oops, I'm a dummy

            onClipEvent(load){
            y=100;
            speed=5;
            radius=100;
            xcenter=250;
            ycenter=150;
            zcenter=100;
            angle=0;
            fl=150;
            }

            onClipEvent(enterFrame){
            z=Math.sin(angle*Math.PI/180)*radius+zcenter;
            scale=fl/(fl+z);
            y=Math.cos(angle*Math.PI/180)*radius;
            _x=x*scale+xcenter;
            _y=y*scale+ycenter;
            _xscale= _yscale = scale*100;
            angle+=speed;
            //if(angle>359){
            //angle-=360;
            //}
            }

            there you go.