我需要删除与 Flex 3 关联数组中的属性关联的值;这可能吗?
例如,假设我像这样创建了这个数组:
var myArray:Object = new Object();
myArray[someXML.@attribute] = "foo";
后来,我需要做这样的事情:
delete myArray[someXML.@attribute];
但是,我在运行时收到此错误消息:
Error #1119: Delete operator is not supported with operand of type XMLList.
我该如何执行此操作?
delete 在 AS3 中的作用不如在 AS2 中那样多:
http://www.gskinner.com/blog/archives/2006/06/understanding_t.html http://www.gskinner.com/blog/archives/2006/06/understanding_t.html
但是,我认为您的问题可以通过简单地使用 toString() 来解决,即
var myArray:Object = new Object();
myArray[[email protected] /cdn-cgi/l/email-protection()] = "foo";
delete myArray[[email protected] /cdn-cgi/l/email-protection()];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)