views:

8

answers:

1

Hello, 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 flash. Can you help me?

+1  A: 

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));
    }
}
nuqqsa
Thanks, you gave me an exellent idea of how to resolve this with the eval function! +1
DomingoSL