|
Publicité ' | |||||||||||||||||||||||
|
|
#1 |
|
Invité de passage
![]() Inscription : juin 2007 Messages : 4 ![]() |
bonjour,
j'ai un flash qui affiche une liste d'items (sous forme d'un clip qui se répète) provenant d'un flux xml. L'affichage se fait actuellement simplement sur une colonne en listant du 1er au dernier item. Je voudrai modifier cet affichage en le scindant en 2 colonnes. J'ai essayé plusieurs choses mais je n'y suis pas arrivé pas. mcProd étant le clip se répétant, qui lui même se trouve dans un clip mcProdList. voici un bout de mon code : // ::::::::::::::::::::::::::::::::::::::::::::::: Niveau liste des produits ::::::::::::::::::::::::::::::: // A shortcut to top level nodes var TopNodes:Array = thisObj.listXML.firstChild.childNodes; // Compteur de fiche produit créée thisObj.nbProduit = 0;//TopNodes.length; // ::::::::::::::::::::::::::::::::::::::::::::::: Niveau produit :::::::::::::::::::::::::::::::::::::::::: // For each child node in the XML file... for(var i:Number = 0; i < TopNodes.length; i++) { /*if( ((Level1 == TopNodes[i].attributes['niveau1']) || (Level1 == "")) && ((Level2 == TopNodes[i].attributes['niveau2']) || (Level2 == "")) && ((Level3 == TopNodes[i].attributes['niveau3']) || (Level3 == "")) )*/ if( ((Level1 == TopNodes[i].attributes['niveau1'])) && ((Level2 == TopNodes[i].attributes['niveau2'])) && ((Level3 == TopNodes[i].attributes['niveau3'])) ) { // Attach the list_item symbol from the library and set up it var mcProd:MovieClip = thisObj.mcProdList.Container.attachMovie("list_item", "list_item_"+thisObj.nbProduit, thisObj.nbProduit); // MAJ du compteur de fiche produit créée thisObj.nbProduit++; // Mémo des attributs du noeud "produit" dans un attribut du MovieClip containeur de la fiche produit mcProd.attributs = TopNodes[i].attributes; //mcProd.attributs.niveau1 //mcProd.attributs.niveau2 //mcProd.attributs.niveau3 // Récupération de toutes les données d'un produit // Use firstChild to iterate through the child nodes of the current node for(var prodNode:XMLNode = TopNodes[i].firstChild; prodNode != null; prodNode = prodNode.nextSibling) { // Si c'est un noeud de bon type (ELEMENT_NODE)... [il'y pas de raison que non !] if(prodNode.nodeType == 1) { // Mémo de la valeur dans un attribut du MovieClip containeur de la fiche produit if(prodNode.firstChild.nodeValue == undefined) { mcProd[prodNode.nodeName] = ""; } else { mcProd[prodNode.nodeName] = prodNode.firstChild.nodeValue; } } } // Set up each top menu attributes... oXY = {x:thisX, y:thisY}; mcProd.globalToLocal(oXY); mcProd._x = oXY.x;//thisX; mcProd._y = oXY.y;//thisY; mcProd.Libelle.iniWidth = mcProd.Libelle._width; mcProd.Libelle.autoSize = "left"; mcProd.Libelle.text = mcProd["titre"]; mcProd.Marque.iniWidth = mcProd.Marque._width; mcProd.Marque.autoSize = "left"; mcProd.Marque.text = mcProd["marque"]; //mcProd.Description.text = mcProd["description"]; mcProd.DescriptionWeb.text = mcProd["description_web"]; //mcProd.Delai.text = mcProd["ChaineDelai"]; mcProd.Prix.text = mcProd["prix_vente_ttc"]+" €"; //mcProd.ref = mcProd["id_produit"]; mcProd.ImgZoomX = mcProd.ImgZoom._x; mcProd.ImgZoomY = mcProd.ImgZoom._y; mcProd.ImgZoomHeight = mcProd.ImgZoom._height; mcProd.ImgZoomWidth = mcProd.ImgZoom._width; _root.txtnbpr.text = nbProduit; // Prepare next element position thisY += mcProd._height; |
|
|
00
|
|
|
#2 | ||
![]() ![]() Développeur informatique Inscription : octobre 2006 Messages : 1 606 ![]() |
Lut,
apparenment il s'agit d'adapter le pti algo pour avoir deux colonnes ; il faut savoir comment compte tu placer les elements, C1 | C2 C3 | C4 C5 | C6 ou C1 | C4 C2 | C5 C3 | C6 j'ai pas trop compri le passage pour placer le clip a la bonne position : Code :
+ |
||
|
|
00
|
|
|
#3 | ||
|
Invité de passage
![]() Inscription : juin 2007 Messages : 4 ![]() |
c'est bon..
je me servait bien d'un modulo mais je l'avais mis dans une boucle, du ça partais un peu n'importe comment. du coup ça marche bien comme ça : Code :
|
||
|
|
00
|
Copyright © 2000-2012 - www.developpez.com