Hi,
What is the best way to debug a CRASHING flash app ? (no exception, my application just crash) I am actualy facing a big problem: my app (full-flash website) was working fine with the flashplayer 9 but crash with the flashplayer 10...
Here is the BAD method who crash my app with FP10. After removing the call to this method everything was working properly with FP10.
public static function drawWedgeCrown(g : Graphics,a : Number,r : Number,r2 : Number, n : Number, c : Number, t : Number) : void {
var x : Number ;
var y : Number;
g.beginFill(c, t);
g.moveTo(r, 0);
g.lineTo(r, 0);
var teta : Number = 0;
var dteta : Number = 2 * Math.PI / n;
while(teta < a) {
x = r * Math.cos(teta);
y = -r * Math.sin(teta);
g.lineTo(x, y);
teta += dteta;
}
x = r * Math.cos(a);
y = -r * Math.sin(a);
g.lineTo(x, y);
x = r2 * Math.cos(a);
y = -r2 * Math.sin(a);
g.lineTo(x, y);
teta = a;
dteta = 2 * Math.PI / n;
var cpt : int = 0;
while(teta > 0) {
cpt++;
x = r2 * Math.cos(teta);
y = -r2 * Math.sin(teta);
g.lineTo(x, y);
teta -= dteta;
}
x = r2 * Math.cos(0);
y = -r2 * Math.sin(0);
g.lineTo(x, y);
g.lineTo(r, 0);
g.endFill();
}
OK, i finaly found the real PROBLEM... it was not the method in it self. I was passing NaN for the "A" argument causing an infinite loop...