OK, so this is almost there, but not quite.  If I do as Kenneth
suggested (and this should be able to be reproduced), 

var testXML:XML = <data>
                                <topic title="Coldplays New Album" />
                                <topic title="The Dark Knight" />
                                <topic title="Arrested Development: The
Movie" />

var re:RegExp = new RegExp("^"+searchInput.text);
var xmlListSearch:XMLList = testXML.topics.topic.(re["test"](@title));
trace("result: "+xmlListSearch.toXMLString());

(Assuming there is a TextInput text field on the stage and a function
run when a button is clicked to run the regex search), if I enter the
search term, "The", it only returns the second node containing "The Dark
Knight", not the third topic node, which has a "The" in it's title
attribute as well.  If I put "Dark", it doesn't return anything.  So it
seems it's only searching nodes where the search term is the first item.
How can I modify the regular expression above to find all nodes
containing an element of the search term?


Jason Merrill 
Bank of America 
Enterprise Technology & Global Risk L&LD 
Instructional Technology & Media

Join the Bank of America Flash Platform Developer Community 

Are you a Bank of America associate interested in innovative learning
ideas and technologies?
Check out our internal  GT&O Innovative Learning Blog & subscribe. 

Flashcoders mailing list

Reply via email to