You can condense it a little:

var xmllist:XMLList = xml.p.(child("s") == animal);

-- 
Kenneth Kawamoto
http://www.materiaprima.co.uk/

On 3 February 2010 15:21, Jer Brand <[email protected]> wrote:
> Give this a try -- worked for me : )
>
>
> var x:XML = new XML("<all><p id='1'><s>dog</s></p><p
> id='2'><s>cat</s></p><p id='3'><s>bird</s></p><p
> id='4'><s>dog</s></p><p/></all>") ;
> var animal:String = "dog" ;
> var list:XMLList = x.p.(child('s').text()[0] == animal) ;
> trace(list.toXMLString())
>
> // traces...
>
> <p id="1">
>  <s>dog</s>
> </p>
> <p id="4">
>  <s>dog</s>
> </p>
>
> Jer

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to