简体   繁体   English

在AS3中,如何删除在对象上设置的所有属性

[英]In AS3 how would you delete all the properties that have been set on an object

Does anyone know how I could remove properties that have been set on a static object in AS3? 有谁知道我如何删除在AS3中的静态对象上设置的属性?

Ideally it would be something like - 理想的情况是-

foreach(property in GlobalStaticVar.properties) {
    GlobalStaticVar.removeProperty(property);
}

Does anyone have any hints where to look. 有没有人在哪里找任何提示。

Sorry I am a bit of a flash noob. 对不起,我有点傻了。

Thanks for your time. 谢谢你的时间。

Try: 尝试:

for (var p:String in GlobalStaticVar) {
    delete GlobalStaticVar[p];
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM