当前位置:软件学习 > Flash >>

as 复制一个xml对象

创建了一个复制的原始xml对象,以便它可以按值传递

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);
    }
  }
}

补充:flash教程,As3.0
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,