Edit02: The reason why the flash crash because the wrong distance cause the programm to divide something by 0 - well I found the error on my own, but my question still is, is there something like a crashreport that you can add / edit?
Edit: I found the bug in the script its located here
if(baseVerticies[vertX]-boneObj.x < 0){
distance = distance*-1;
}
at one point it generates the wrong distance, but this is not what the program causes to crash, I know how to solve the bug but it would still be interesting how to add functions to detect flash crash reasons
OLD: Hey I am currently testing the CS6 Flash demo but one function always kills flash and I dont get any error messages, so my question is ... how can I hunt the bug down?
The only things I know: it crashes when I call a certain function (the one which I posted below) - it doesnt crash on the first call ... more like on the third or second
is there any way to add debugEvents or something als that would be usefull to track the error?
thx in advance =)
public function rotateBone(boneObj : Bone, point : Point){
//rotates the boneGrafik
boneObj.rotation = (point.x+boneObj.old_rotation)/2;
if(axis == "horizontal"){
var firstV : int = selected_bone*(squares+1)*2;
var lastV : int = selected_bone*(squares+1)*2 + squares*2;
var radius : Number = Math.sqrt((verticies[lastV]-verticies[firstV])*(verticies[lastV]-verticies[firstV])+
(verticies[lastV+1]-verticies[firstV+1])*(verticies[lastV+1]-verticies[firstV+1]));
//will be exectued for every single vertex
for(var s = 0; s<=squares; s++){
var vertX : int = selected_bone * (squares+1) * 2 + s*2;
var distance : Number = Math.sqrt((verticies[vertX]-boneObj.x)*(verticies[vertX]-boneObj.x)+
(verticies[vertX+1]-boneObj.y)*(verticies[vertX+1]-boneObj.y));
//calculates Vector
var rads:Number = boneObj.rotation / 180 * Math.PI;
var p:Point = new Point();
p.x=Math.cos(rads);
p.y=Math.sin(rads);
//baseMesh is used in order to check if the vertex pos is positiv / negative
if(baseVerticies[vertX]-boneObj.x < 0){
distance = distance*-1;
}
verticies[vertX] = boneObj.x + p.x * radius * (distance/radius);
verticies[vertX+1] = boneObj.y + p.y * radius * (distance/radius);
}
}else if (axis == "vertical"){
for(var r = 0; r<=rows; r++){
vertX = r * (squares+1) * 2 + selected_bone * 2;
}
}
updateMesh();
}