【发布时间】:2009-06-20 17:23:59
【问题描述】:
so.... eval() 不可能,有什么想法吗?我也不知道如何在 actionscript 3 中使用“this”表达式或 set()(我似乎找不到任何完整的参考),只是通过 php 文件说一个多变量(test1、test2、test3、. ..) 由“echo”发送,flash 应用程序如何收到它?我试图不在 mysql 上使用 xml 到 php 来闪存应用程序。简单地说,如何将字符串更改为变量?
例子
(在 as3-actions 框架面板中)
function datagridfill(event:MouseEvent):void{
var varfill:URLVariables = new URLVariables();
varfill.tell = "do it";
var filler:URLRequest = new URLRequest();
filler.url = "http://127.0.0.1/flashdbas3/sendin.php";
filler.data = varfill;
var filling:URLLoader = new URLLoader();
filling.dataFormat = URLLoaderDataFormat.VARIABLES;
filling.load(filler);
filling.addEventListener(Event.COMPLETE, datain);
function datain(evt:Event){
var arraygrid:Array = new Array();
testing.text = evt.target.Name2 // worked
// just say i = 1
i=1;
arraygrid.push({Name:this["evt.target.Name"+i],
Test:this.["evt.target.Test"+i]}); // error
//or
arraygrid.push({Name:this["Name"+i],
Test:this.["Test"+i]}); // error too
// eval() noexistent, set() didn't worked on actions frame panel
//?????
}
};
我希望它很清楚。
【问题讨论】:
-
我发布了一个答案,但您的问题没有明确表述。为清楚起见进行修改,并添加更详细的说明来说明您正在尝试执行的操作,您将获得更好的结果。
标签: actionscript-3