本文介绍了如何删除从一个基于对象的关联数组中的Flex 3的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要删除与在Flex 3关联数组属性关联的值;这可能吗?
I need to remove the value associated with a property in a Flex 3 associative array; is this possible?
例如,假设我创建了这个阵列像这样:
For example, suppose I created this array like so:
var myArray:Object = new Object();
myArray[someXML.@attribute] = "foo";
后来,我需要做的是这样的:
Later, I need to do something like this:
delete myArray[someXML.@attribute];
不过,我得到这个错误信息在运行时:
However, I get this error message at runtime:
Error #1119: Delete operator is not supported with operand of type XMLList.
我如何执行此操作?
How do I perform this operation?
推荐答案
删除不这样做,因为它在AS2做尽可能多的在AS3:
delete doesn't do as much in AS3 as it did in AS2:
http://www.gskinner.com/blog/archives/2006/06/understanding_t.html
不过,我认为你的问题可能只需使用的toString(),即可以解决
However, I think your problem might be solved by simply using toString(), i.e.
var myArray:Object = new Object();
myArray[[email protected]()] = "foo";
delete myArray[[email protected]()];
这篇关于如何删除从一个基于对象的关联数组中的Flex 3的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!