Use a variable's value as the element name to find : Bracket syntax : XML Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » XML » Bracket syntax »

 

Use a variable's value as the element name to find


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var nodeName:String = "color";
        var fruit:XML = <fruit><color>red</color></fruit>;
        tracefruit[nodeName] );
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo XML
» Bracket syntax