в следующем коде нужно чтобы в какую-нибудь переменную сохранялась сумма всех длинн. т.е. есть переменная dlinna и надо например в переменную dlinnasum сохранять длины всех векторов.

Код:
this.createEmptyMovieClip("canvas_mc", this.getNextHighestDepth());
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
this.isDrawing = true;
this.orig_x = _xmouse;
this.orig_y = _ymouse;
coordinatex = _xmouse;
coordinatey = _ymouse;
this.target_mc = canvas_mc.createEmptyMovieClip("", canvas_mc.getNextHighestDepth());
};
mouseListener.onMouseMove = function() {
if (this.isDrawing) {
this.target_mc.clear();
this.target_mc.lineStyle(1, 0xFF0000, 100);
this.target_mc.moveTo(this.orig_x, this.orig_y);
this.target_mc.lineTo(_xmouse, _ymouse);
this.target_mc.lineTo(this.orig_x, this.orig_y);
}
updateAfterEvent();
};
mouseListener.onMouseUp = function() {
coordinatex1 = _xmouse;
coordinatey1 = _ymouse;
katety = Math.abs(coordinatey-coordinatey1);
katetx = Math.abs(coordinatex-coordinatex1);
dlinna = Math.sqrt(katetx*katetx+katety*katety);
this.isDrawing = false;
};
Mouse.addListener(mouseListener);
сам не могу. ломаю голову целый день.
заранее спасибо.