dongtang1918 2010-06-02 17:17
浏览 40
已采纳

ActionScript 2上的智能编码(从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 flash. Can you help me?

  • 写回答

1条回答 默认 最新

  • doujiu6976 2010-06-02 18:51
    关注

    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));
        }
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试