Código ActionScript :
var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, xmlComplete); loader.load(new URLRequest("datos.xml")); function xmlComplete(e:Event):void { var myXML:XML = new XML(e.target.data); var menu:Sprite = new Sprite(); menu.x = 10; menu.y = 10; addChild(menu); for (var i:int = 0; i < myXML.boton.length(); i++) { var tmp:boton = new boton(); tmp.titulo.texto_txt.text = myXML.boton[i].@texto; tmp.y = (tmp.height + 2) * i; tmp.ruta = myXML.boton[i].@seccion; tmp.addEventListener(MouseEvent.CLICK, onClick); tmp.mouseChildren = false; menu.addChild(tmp); } } function onClick(e:MouseEvent):void { trace (tmp); };
El XML:
<menu>
<boton texto="INICIO" seccion="INICIO"/>
<boton texto="GALERIA" seccion="GALERIA"/>
</menu>
mi duda es como hago para que se creen columnas por ejemplo si la cantidad de datos en XML es mayor a X numero por ejemplo que si es mayor a 5 palabras que se forme otra columna?
Gracias.