Skip to main content
March 10, 2011
Answered

How to get Number from xml in flash?

  • March 10, 2011
  • 1 reply
  • 443 views

hi

this is my XML file

<?xml version="1.0"?>

<ArrayHolder>

        <level1>"1","1","1"</level1>

     <level2>2,2,1,2,2</level2>

<level3>1,3,3,3,1</level3>

</ArrayHolder>

I want to store level1's no in "levelArray".

Thanks,

JaxNa

This topic has been closed for replies.
Correct answer kglad

you still have one quote left but once that's fixed, split each node value on the commas and then loop through the array casting each element to a number.

1 reply

kglad
Community Expert
Community Expert
March 10, 2011

why do you have quotes in that first node?

March 10, 2011

ohhh sorry this is my mistake.

<?xml version="1.0"?>

<ArrayHolder>

        <level1>"1,1,1,1</level1>

     <level2>2,2,2,2,2</level2>

<level3>1,3,3,3,1</level3>

</ArrayHolder>

here it corrected.

Thanks,

JaxNa

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
March 10, 2011

you still have one quote left but once that's fixed, split each node value on the commas and then loop through the array casting each element to a number.