copy() method creates a duplicate of the original XML object so that it can be passed by value rather than reference. : Copy : XML Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » XML » Copy »

 

copy() method creates a duplicate of the original XML object so that it can be passed by value rather than reference.


 

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


        var template:XML = <person><name><first /><last /></name></person>;
        var me:XML = template.copy();
        me.name.first = "Mims";
        me.name.last = "Wright";
        trace(template);
        
        trace(me);
    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo XML
» Copy