Bonjour,

J'essaye de faire un ActionScript qui lit un fichier XML, trace des traits pour réaliser une carte.
Il marche sans problème, mais je n'arrive pas à ajouter un Mouse_Over pour changer la couleur des traits lorsque l'on passe la souris dessus.

Pouvez-vous m'expliquer ?

Merci, gcvoiron.

Mon fla :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
import flash.display.*;	
import flash.events.*;
import flash.display.Sprite;
import flash.net.navigateToURL;
import flash.net.URLRequest;
import flash.net.URLVariables;
 
 
Fichier_XML = new XML();
        Fichier_XML.ignoreWhite = true;
        Fichier_XML.load("fichier.xml");
        Fichier_XML.onLoad = function(Reussite) 
		{
        	if (Reussite) 
			{
				x = Fichier_XML.firstChild;
				for(i = 0; x.childNodes[i] != undefined; i++) 
				{					
					mc1.graphics.lineStyle(15,116233102,255);
					j = i+1 ; 
					_root.createEmptyMovieClip("ligne",j);
					ligne.lineStyle (3, x.childNodes[i].attributes.color, 100);
					ligne.moveTo( x.childNodes[i].attributes.x_debut,x.childNodes[i].attributes.y_debut);
					ligne.lineTo( x.childNodes[i].attributes.x_fin, x.childNodes[i].attributes.y_fin);                  
				}
        	}
			else 
			{
				Voir_xml = "Erreur lors du chargement du fichier XML"; 
			}
        };
Mon XML :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
<?xml version='1.0' encoding="UTF-8" ?>
<carte>
        <axe color="0xC700FF" x_debut="200" y_debut="50" x_fin="200" y_fin="150"></axe>
        <axe color="0x0055FF" x_debut="200" y_debut="150" x_fin="250" y_fin="250"></axe>
        <axe color="0x00FF00" x_debut="200" y_debut="150" x_fin="150" y_fin="250"></axe>
</carte>