flash mx pro returnes these error after saving a cube into an as file:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 103: Parameter name expected
function draw3d(screenPoints, this){
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 153: Unexpected '}' encountered
};
Total ActionScript Errors: 2 Reported Errors: 2
how can i install ming on windows?
thank you
here it is all the exported file if you mind:
//comment following line to include
//action script as sprite
_root.createEmptyMovieClip('theScene', 1);
//uncomment following line if you want
//include your action script as a sprite
//theScene=this;
theScene._x = 200;
theScene._y = 200;
focalLength = 300;
// creates a 3d point
make3DPoint = function(x,y,z){
var point = new Object();
point.x = x;
point.y = y;
point.z = z;
return point;
};
make2DPoint = function(x, y){
var point = new Object();
point.x = x;
point.y = y;
return point;
};
Transform3DPointsTo2DPoints = function(points, axisRotations){
var TransformedPointsArray = [];
var sx = Math.sin(axisRotations.x);
var cx = Math.cos(axisRotations.x);
var sy = Math.sin(axisRotations.y);
var cy = Math.cos(axisRotations.y);
var sz = Math.sin(axisRotations.z);
var cz = Math.cos(axisRotations.z);
var x,y,z, xy,xz, yx,yz, zx,zy, scaleFactor;
var i = points.length;
while (i--){
x = points[i].x;
y = points[i].y;
z = points[i].z;
// rotation around x
xy = cx*y - sx*z;
xz = sx*y + cx*z;
// rotation around y
yz = cy*xz - sy*x;
yx = sy*xz + cy*x;
// rotation around z
zx = cz*yx - sz*xy;
zy = sz*yx + cz*xy;
scaleFactor = focalLength/(focalLength + yz);
x = zx*scaleFactor;
y = zy*scaleFactor;
z = yz;
TransformedPointsArray[i] = make2DPoint(x, y, -z, scaleFactor);
}
return TransformedPointsArray;
};
point_blender=[
make3DPoint(1.0,1.0,-1.0),
make3DPoint(1.0,-1.0,-1.0),
make3DPoint(-1.0,-1.0,-1.0),
make3DPoint(-1.0,1.0,-1.0),
make3DPoint(1.0,1.0,1.0),
make3DPoint(-1.0,1.0,1.0),
make3DPoint(-1.0,-1.0,1.0),
make3DPoint(1.0,-1.0,1.0),
make3DPoint(1.0,1.0,-1.0),
make3DPoint(1.0,1.0,1.0),
make3DPoint(1.0,-1.0,1.0),
make3DPoint(1.0,-1.0,-1.0),
make3DPoint(1.0,-1.0,-1.0),
make3DPoint(1.0,-1.0,1.0),
make3DPoint(-1.0,-1.0,1.0),
make3DPoint(-1.0,-1.0,-1.0),
make3DPoint(-1.0,-1.0,-1.0),
make3DPoint(-1.0,-1.0,1.0),
make3DPoint(-1.0,1.0,1.0),
make3DPoint(-1.0,1.0,-1.0),
make3DPoint(1.0,1.0,1.0),
make3DPoint(1.0,1.0,-1.0),
make3DPoint(-1.0,1.0,-1.0),
make3DPoint(-1.0,1.0,1.0)];
cubeAxisRotations = make3DPoint(0,0,0);
rotateCube = function(){
cubeAxisRotations.y += -this._xmouse/1000;
cubeAxisRotations.x += this._ymouse/1000;
var screenPoints = Transform3DPointsTo2DPoints(point_blender, cubeAxisRotations);
this.clear();
this.lineStyle(2,0xbbc4e8,75);
draw3d(screenPoints,this);
};
function draw3d(screenPoints, this){
this.moveTo(screenPoints[0].x,screenPoints[0].y);
this.beginFill(0xDD0000);
this.lineTo(screenPoints[0].x,screenPoints[0].y);
this.lineTo(screenPoints[1].x,screenPoints[1].y);
this.lineTo(screenPoints[2].x,screenPoints[2].y);
this.lineTo(screenPoints[3].x,screenPoints[3].y);
this.lineTo(screenPoints[0].x,screenPoints[0].y);
this.endFill();
this.moveTo(screenPoints[4].x,screenPoints[4].y);
this.beginFill(0xDD0000);
this.lineTo(screenPoints[4].x,screenPoints[4].y);
this.lineTo(screenPoints[5].x,screenPoints[5].y);
this.lineTo(screenPoints[6].x,screenPoints[6].y);
this.lineTo(screenPoints[7].x,screenPoints[7].y);
this.lineTo(screenPoints[4].x,screenPoints[4].y);
this.endFill();
this.moveTo(screenPoints[8].x,screenPoints[8].y);
this.beginFill(0xDD0000);
this.lineTo(screenPoints[8].x,screenPoints[8].y);
this.lineTo(screenPoints[9].x,screenPoints[9].y);
this.lineTo(screenPoints[10].x,screenPoints[10].y);
this.lineTo(screenPoints[11].x,screenPoints[11].y);
this.lineTo(screenPoints[8].x,screenPoints[8].y);
this.endFill();
this.moveTo(screenPoints[12].x,screenPoints[12].y);
this.beginFill(0xDD0000);
this.lineTo(screenPoints[12].x,screenPoints[12].y);
this.lineTo(screenPoints[13].x,screenPoints[13].y);
this.lineTo(screenPoints[14].x,screenPoints[14].y);
this.lineTo(screenPoints[15].x,screenPoints[15].y);
this.lineTo(screenPoints[12].x,screenPoints[12].y);
this.endFill();
this.moveTo(screenPoints[16].x,screenPoints[16].y);
this.beginFill(0xDD0000);
this.lineTo(screenPoints[16].x,screenPoints[16].y);
this.lineTo(screenPoints[17].x,screenPoints[17].y);
this.lineTo(screenPoints[18].x,screenPoints[18].y);
this.lineTo(screenPoints[19].x,screenPoints[19].y);
this.lineTo(screenPoints[16].x,screenPoints[16].y);
this.endFill();
this.moveTo(screenPoints[20].x,screenPoints[20].y);
this.beginFill(0xDD0000);
this.lineTo(screenPoints[20].x,screenPoints[20].y);
this.lineTo(screenPoints[21].x,screenPoints[21].y);
this.lineTo(screenPoints[22].x,screenPoints[22].y);
this.lineTo(screenPoints[23].x,screenPoints[23].y);
this.lineTo(screenPoints[20].x,screenPoints[20].y);
this.endFill();
};
//rotateCube();
theScene.onEnterFrame = rotateCube;