string from php script to flash

馋奶兔 提交于 2020-01-06 13:27:50

问题


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


回答1:


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
}


来源:https://stackoverflow.com/questions/7620476/string-from-php-script-to-flash

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!