Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Flash/Flex > Flash
Flash Forum d'entraide sur la technologie Flash (Cours, FAQs, Sources)
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 13/06/2007, 10h09   #1
Membre à l'essai
 
Inscription : mai 2006
Messages : 137
Détails du profil
Informations forums :
Inscription : mai 2006
Messages : 137
Points : 20
Points : 20
Par défaut [Action script] Mouse_over

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 :
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 :
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>
gcvoiron est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/06/2007, 12h08   #2
Membre à l'essai
 
Inscription : mai 2006
Messages : 137
Détails du profil
Informations forums :
Inscription : mai 2006
Messages : 137
Points : 20
Points : 20
J'ai pourtant mis un Mouse_Over, mais il n'est pas pris en compte :
Code :
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
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++) 
				{
					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);                  
					ligne.addEventListener(MouseEvent.MOUSE_OVER,mouseClick_handler);
					function mouseClick_handler()
					{
						//Fonctions
					}
				}
        	}
			else 
			{
				Voir_xml = "Erreur lors du chargement du fichier XML"; 
			}
        };
gcvoiron est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/06/2007, 17h28   #3
Membre à l'essai
 
Inscription : mai 2006
Messages : 137
Détails du profil
Informations forums :
Inscription : mai 2006
Messages : 137
Points : 20
Points : 20
Personne n'a une idée ?
gcvoiron est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 20h24.


 
 
 
 
Partenaires

Hébergement Web