Determining the Type of Content in a Node : Node type « XML « Flash / Flex / ActionScript






Determining the Type of Content in a Node

 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

        var contentTest:XML = <test>
                                <a />
                                <b>Lorem Ipsum</b>
                                <c>
                                   <d />
                                </c>
                              </test>;
        trace(contentTest.a.hasSimpleContent());  // Displays: true
        trace(contentTest.b.hasSimpleContent());  // Displays: true
        trace(contentTest.c.hasSimpleContent());  // Displays: false
        trace(contentTest.d.hasComplexContent()); // Displays: false
    }
  }
}

        








Related examples in the same category