package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var fruits:XML = <fruits>
<fruit color="red">
<name>Apple</name>
</fruit>
<fruit color="orange">
<name>Orange</name>
</fruit>
<fruit color="green">
<name>Pear</name>
</fruit>
<fruit color="red">
<name>Watermelon</name>
</fruit>
</fruits>;
trace( fruits.fruit.(name == "Apple").@color );
}
}
}
|