Forum-webmaster
Technique - programmation => Langages de programmation divers => Message commencé par: raphy1609 le le 07-06-2006 a 13:49:45

Titre: aplication flash xml avec animation
Posté par: raphy1609 le le 07-06-2006 a 13:49:45

Voila mon pb :
g crée un fichier php qui génère un xml, et je recupère les données du xml dans flash ( juske la ca va ). Dans ce fichier xml il y a d nom d'image que je recupère pour faire afficher ces images dans flash. Si une image est ajouté dans la partie admin elle se met otomatiquemen dans flash. ces images me créer donc un bandeau d'image et j'aimerai faire que ce bandeau défile comme icihttp://www.trucsweb.com/Flash/trucs.asp?no=365&type=20 (http://www.trucsweb.com/Flash/trucs.asp?no=365&type=20)
( c'est un bandeau avec des images qui defile du coté ou es la souris )

voila mon code :

var tableau = new Array ();
_root.photo_principale._visible = false;
_root.image_produit._visible = false;
_root.classic_clip._visible = false;//on cache le clip qui servira de modele pour les miniatures
coordx = 255;
coordy = 425;
coordx2 = 2
coordy2 = 10;

system.useCodepage = true;
rss_xml = new XML();
rss_xml.ignoreWhite = true;
rss_xml.onLoad = function(ok) {
   if (ok = true) {
var tousProduits = rss_xml.firstChild.firstChild.childNodes;
   
for (i = 0; i < tousProduits.length; i++) {
image = tousProduits.childNodes[0].firstChild.nodeValue;
      petitedescr = tousProduits.childNodes[1].firstChild.nodeValue;
gdedescr = tousProduits.childNodes[2].firstChild.nodeValue;
      prix = tousProduits.childNodes[3].firstChild.nodeValue;
      famille = tousProduits.childNodes[4].firstChild.nodeValue;
      sousfamille = tousProduits.childNodes[5].firstChild.nodeValue;
      etat = tousProduits.childNodes[6].firstChild.nodeValue;
      
      ExisteDeja = false;
      for(k=0;k<tableau.length;k++){
         if(tableau[k]==famille){
            ExisteDeja = true;
         }
      }
      if(!ExisteDeja){
      tableau = famille;
      }
      
      _root.image_produit.duplicateMovieClip("image_produit_"+i,i+5000);//création du nouveau clip a partir du modele
      with(_root["image_produit_"+i]){
         _x = coordx;
         _y = coordy;
         with(content){
            
            loadMovie("uploadminiature/"+image);//chargement de l'image dans le clip
         }
         
         with(lien_image){
            _height = 65;
            _width = 80;
         }
         lien_image.onPress = function(){ // on charge la grande image et le texte principal
            idproduit = Number(_name.split("_")[2]);
            with(_parent.contenu.photo_principale){
               loadMovie("uploaddescription/"+tousProduits[idproduit].childNodes[0].firstChild.nodeValue);
               //position et taille de la photo principale
               _x = 10;
               _y = 70;
               _visible = true;
            }
            with(_parent.contenu.texte_principal){ // traitement du texte principal
               text = tousProduits[idproduit].childNodes[1].firstChild.nodeValue+" - "+tousProduits[idproduit].childNodes[2].firstChild.nodeValue+" - Prix : "+tousProduits[idproduit].childNodes[3].firstChild.nodeValue+" - "+tousProduits[idproduit].childNodes[4].firstChild.nodeValue+" - "+tousProduits[idproduit].childNodes[5].firstChild.nodeValue+" - "+tousProduits[idproduit].childNodes[6].firstChild.nodeValue;
               _x = 550;
               _y = 150;
            }
         }         
      }
      coordx += 82;
      
}
   
   for(j=0;j<tableau.length;j++){
      _root.classic_clip.duplicateMovieClip("classic_clip_"+j,j+1);
      with(_root["classic_clip_"+j]){
            _x = coordx2;
            _y = coordy2;
            coordx2 += 130;            
            titre.text = tableau[j];
      }      
   }
   }
}
stop();
rss_xml.load("fichier.xml");


Pouvez m'aider sil vous plaît !!!!!!
merci d'avance.


Forum-webmaster | Actionné par YaBB SE
© 2001-2003, YaBB SE Dev Team. Tous droits réservés.