如果你有一个变量,它是一个影片剪辑,雪碧,字符串,数字,INT,UINT,或者逻辑,你删除它的参考加入:
myVariable的= NULL;
或
删除(myVariable的);
解决方案
将其设置为null是足以去除引用它包含的对象。
注意的语法删除
运算符是删除object.member
,其中删除成员
从一个键对象
,因此将删除的引用,不管它包含的内容。
注意,GC只能出现一次的所有的引用给定对象都被删除。
If you have a variable that is a MovieClip, Sprite, String, Number, int, uint, or a Boolean, do you remove it's reference by adding:
myVariable = null;
OR
delete(myVariable);
解决方案
setting it to null is sufficient to remove a reference to the object it contained.
Note that the syntax of the delete
operator is delete object.member
, which removes member
as a key from object
, and as such will remove a reference to whatever it contains.
note that GC can only occur once all references to a given object are removed.