开发者

How to change the value of an object property in actionscript3?

I'll start by showing my code.

var modules:Object = new Object();
modules = DPServices.getModules.lastResult;
for each (var item:Object in modules){
    if(item.menu == 0){
        // Don't know what to do here!!
    }
}
modulesDG.dataProvider = modules;

By the way this is 开发者_如何学JAVAActionScript 3.

What I am trying to do is change the value from a 0 to 'No' or a 1 to 'Yes'. I have tried modules.menu = 'no', modules.item.menu = 'no', and modules.@menu = 'no'. So how do I change this value?


Is modules an object of objects? If not, this should be fine:

item.menu = 'no';


You want to change menu to 1 if it's 0?

Isn't it enough to just do:

if(item.menu == 0){
    item.menu = 1;
}

Though I'm not exactly sure what you're asking for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜