PDA

View Full Version : [AS2] combobox xml


patrick123
11-22-2011, 01:08 PM
in my xml i basically have this
<image><colors> red1, blue1 </colors></image>
i can call it into flash with this where number is passed in a function

colorlist1.addItem({cname:myImages[number].childNodes[3].firstChild, label:cname});

alright but my question is if there is a way to split this up so that when it is displayed in flash i get this:
red
blue
and not this : red,blue

thank you for your response.

patrick123
11-23-2011, 02:40 PM
i have been able to split the result gotten using this bit of code

function combobox(number)
{
_root.mycolors = myImages[number].childNodes[3].firstChild;
_root.mysizes = myImages[number].childNodes[4].firstChild;

colorsplit = mycolors.nodeValue;
trace(colorsplit.split(","));
trace(colorsplit);
//add colors into combo box
colorlist1.addItem({cname:colorsplit.split(",",2).join("/n"),label:cname});
}


but all iget in the combo box is red1/nblue. it still refuses to go to a new line, how can i get it to go to a new line please...anybody