_global.Route = function(nom,prof,x1,y1,x2,y2,parent) {
this.nom = nom;
this.prof = prof;
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
this.parent = parent;
}
Route.prototype.affichage = function() {
this.clip = this.parent.createEmptyMovieClip(this.nom , this.prof);
this.clip.createEmptyMovieClip("dessaim" ,1);
var longueur = Math.sqrt((this.y2 - this.y1)*(this.y2 - this.y1) + (this.x2 - this.x1)*(this.x2 - this.x1));
var angle = (Math.atan2(this.y2-this.y1, this.x2-this.x1)/Math.PI)*180;
this.clip._x = this.x1;
this.clip._y = this.y1;
this.clip.dessaim.lineStyle(1, 0xCCCCCC, 100)
this.clip.dessaim.beginFill(0xCCCCCC, 100)
this.clip.dessaim.moveTo(0,0);
this.clip.dessaim.lineTo(longueur ,0);
this.clip.dessaim.lineTo(longueur,10);
this.clip.dessaim.lineTo(0,10);
this.clip.dessaim.lineTo(0,0);
this.clip.dessaim.endFill();
this.clip.dessaim._rotation = angle;
this.clip.onPress = function() {//PROBLEME : n'affiche jamais le test
trace("i");
}
}
Route.prototype.efface = function() {
this.clip.removeMovieClip();
this.clip = undefined;
}
je ne comprend pas pourquoi onPress ne fonctione pas avec les instance de cette classe j'ai essayé de l'implementer a plusieur endroit mais sans suxxer :X