Mega Code Archive

 
Categories / Flash ActionScript / XML
 

An element is equal to an XML attribute if the element contains no child and the text contained by the element matches the attribute v

package{   import flash.display.Sprite;      public class Main extends Sprite{     public function Main(){         var product:XML = <PRODUCT QUANTITY="1"><COST>1</COST></PRODUCT>;         trace(product.@QUANTITY == product.COST);  // Displays: true     }   } }