Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

XML as an array

I have an xml file containing swear words that I want blocked from my input boxes in flash. I want to know how I can turn this xml file into an array in flash, then when my submit button is pressed, it checks the input box for any of these words and if it finds one, my dynamic text box says "no swearing"

<?xml version="1.0" encoding="UTF-8"?>
<swearArray>
      <item label="mouse"/>
      <item label="dog"/>  //These are just examples
      <item label="cat"/>
</swearArray>

Any tutorials, source codes, or anything like that would be a great help.
Thanks
Edders
0
edders85
Asked:
edders85
1 Solution
 
blue-genieCommented:
Hi there. Go have a look at the other thread that's dealing with the same type of thing.
(In the previously answered questions - PAQ)

I tried that using attributes, but I couldn't get it to pull the attribute out nicely (I'm not a xml guru) - but that should give you an idea how to do it, or alternatively, rewrite your xml.

blu.
0
 
OBCTCommented:
Edders85,

I am no xml expert either, however using <item label> is something you would use populate a componant (combo box for example). Using blu's suggestion in the following question would be alot more effective for what you are trying to achieve.
http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_20823812.html

Cheers

-OBCT
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now