开发者

Smart coding on ActionScript 2 (importing vars from a php)

i have a php who when is executed it give me a couple of vars in this format:

&lVar1=DATA1&&lVar2=DATA2&&lVar3=DATA3 and soo...

The problem is that i dont know the quantity of lVar the php script is gonna give in any time, so i cant figure out a smart script in AS2 to import all of them into a array to my flas开发者_Go百科h. Can you help me?


I wouldn't call this smart coding but, really, I can't think of any elegant way of doing this using loadVars:

loadText.onLoad = function() {
    var myArr:Array = new Array();
    for(i = 1; i <= loadText.total; i++) {
        myArr.push(eval("loadText.IVar" + i));
    }
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜