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>
                        <topics>
                                <topic title="Coldplays New Album" />
                                <topic title="The Dark Knight" />
                                <topic title="Arrested Development: The
Movie" />
                        </topics>
                </data>;

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?

Thanks,

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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to