Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
as3 flash facebook:有可用的样本吗?_Flash_Actionscript 3_Facebook - Fatal编程技术网

as3 flash facebook:有可用的样本吗?

as3 flash facebook:有可用的样本吗?,flash,actionscript-3,facebook,Flash,Actionscript 3,Facebook,我的项目的目标是通过flash认证使用我的flash应用程序的用户。 在本教程中,我使用Flex成功地实现了这一点 但我不能用闪光灯! 当我下载 我应该使用哪个swc:移动/桌面/网络 然后我尝试使用GraphAPI示例_1_5.zip 得到 API错误代码:191 API错误描述:指定的URL不属于应用程序 错误消息:应用程序不拥有重定向uri 是否有可用的FLASH(非flex)用户认证示例 关于我也有同样的问题,我最后使用了可以从谷歌代码下载的源文件(这些文件也很有教育意义): 这些示

我的项目的目标是通过flash认证使用我的flash应用程序的用户。 在本教程中,我使用Flex成功地实现了这一点

但我不能用闪光灯! 当我下载 我应该使用哪个swc:移动/桌面/网络

然后我尝试使用GraphAPI示例_1_5.zip 得到 API错误代码:191 API错误描述:指定的URL不属于应用程序 错误消息:应用程序不拥有重定向uri

是否有可用的FLASH(非flex)用户认证示例


关于

我也有同样的问题,我最后使用了可以从谷歌代码下载的源文件(这些文件也很有教育意义):

这些示例主要针对Flex或AIR,但一旦掌握了基本知识,就相当简单了。下面是一个例子:

//--- This line should be at the constructor of your main class, so you can tell from the beginning if the user is already logged in facebook and should not be prompted to login again
Facebook.init('your-app-id', handleLogin);
//--- This function is called both as the callback of the init method and the login method
protected function handleLogin($success:Object, $fail:Object):void {
    if ($success) {
        //---- your code to the logged in user
    }
    else{
           Facebook.getLoginStatus  ()  
           Facebook.addJSEventListener('auth.sessionChange', detectLogin)
    }   
}
private function detectLogin($e:Object):void{
        if ($e.status == "connected"){
            //---- your code to the logged in user
            }
        else{
            //---- the user cancelled the request
            }
        }
//-------This function must be called from the login button handler or something like that
public function connect():void {
    //--- here you have to ask for the permissions you need (the permissions are kind of self explanatory, for a full list visit [here][2]. I'm putting these two just for example purposes)
    var permissions:Array = ['publish_stream','user_photos'];
    //--- this method will call a html popup directly from facebook so the user can write his username and password securely. The first parameter is the callback function and the second is a string of the permissions you ask for.
    Facebook.login(handleLogin, {perms:permissions.join(',')});

        }
正如您所看到的,您正在使用“getLoginStatus()”进行双重调用,但没有它,我无法让它工作。我认为这可能不是解决问题的最佳方法,因此,如果有人有更好的解决方案,我将不胜感激:)

。。如何导入“Facebook”?我试图让它工作,但我有错误“1120:访问未定义的财产Facebook”。。