1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| // test.fla
// création des variables d'envoi et de réception
// des valeurs
var loadListe:LoadVars = new LoadVars();
var sendListe:LoadVars = new LoadVars();
// création d'un clip vide qui servira à
// tracer le trajet
_root.createEmptyMovieClip ("ligne",1);
ligne.lineStyle (2, 0x36393D, 100);
// récupération de l'identifiant du trajet
// envoyé par base.php
sendListe.id_trajet = id_trajet;
loadListe.onLoad = function(success:Boolean) {
if (success) {
// création d'un champ de texte contenant le nombre de variables
// passées
_root.createTextField("champ_info", this.getNextHighestDepth(),
0, 0, 20, 20);
set ("champ_info", eval("this.nbinfos"));
// création d'un champ de texte pour chaque variables reçues
for( i = 0 ; i < champ_info ; i++ ) {
_root.createTextField("champ_x" + i,
this.getNextHighestDepth(), 0 ,0, 20 ,20);
_root.createTextField("champ_y" + i,
this.getNextHighestDepth(), 0 ,0, 20, 20);
set ("champ_x" + i, eval("this.x" + i));
set ("champ_y" + i, eval("this.y" + i));
}
ligne.moveTo(champ_x0, champ_y0);
for ( i = 1 ; i < champ_info ; i++ ) {
var x_line = get("this.champ_x" + i);
var y_line = get("this.champ_y" + i);
ligne.lineTo(x_line, y_line);
}
} else {
_root.createTextField("champ_info", this.getNextHighestDepth(),
0, 0, 20, 20);
set ("champ_info", "not loaded");
}
};
sendListe.sendAndLoad("http://asg88.cg81.fr/covoiturage/coor_carte.php",loadListe); |
Partager