Build a property name and, consequently, an element name, dynamically : Bracket syntax : XML Flash / Flex / ActionScript examples


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

 

Build a property name and, consequently, an element name, dynamically


 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var example:XML = <example />;
        
        var id:int 10;
        
        // Create a string to incorporate the value of id in the node name
        example"user" + id "";    
        
        traceexample );
    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo XML
» Bracket syntax