开发者

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

开发者 https://www.devze.com 2023-01-02 14:20 出处:网络
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...

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

精彩评论

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