从PHP脚本字符串到Flash [英] string from php script to flash

查看:249
本文介绍了从PHP脚本字符串到Flash的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Facebook的PHP SDK获取用户的朋友列表。但我正在努力让这个列表闪光。

这个想法是,列表总是新的,取决于用户加载应用程序。所以我需要的是一个.html文件,它是用PHP脚本加载进程的朋友列表和嵌入式闪存.swf PHP将传递信息。



我该如何实现这个?谢谢

解决方案

有两种方法可以做到这一点:

flashvars 添加到要传递给Flash文件的数据中。由于朋友列表很少发生变化,所以应该有效。



或者使用 URLLoader

  var loader:URLLoader = new URLLoader(); 
var request:URLRequest = new URLRequest(http://example.com/yourscript.php);
loader.addEventListener(complete,loader_complete);
loader.loader(request);

private function loader_complete(event:Event):void {
var scriptData:String = event.currentTarget.data;
//进程数据
}


I'm using facebook php sdk to get friend list of an user. But I'm strugling to get that list to flash.

The idea is that the list is always new, depending from the user loading the application. So what I need is one .html file which is loaded with php script to proccess friend list and embedded flash .swf to which php would pass information.

How can I achieve this? thanks

解决方案

There are two ways to do it:

Set the flashvars to the data you want to pass to the Flash file. Since the friend list rarely changes, that should work.

Or use a URLLoader:

var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest("http://example.com/yourscript.php");
loader.addEventListener("complete", loader_complete);
loader.loader(request);

private function loader_complete(event:Event):void {
    var scriptData:String = event.currentTarget.data;
    // process data
}

这篇关于从PHP脚本字符串到Flash的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆