2011-01-08 6 views
0

Flashを使用してFlashアプリケーションを使用するユーザーを自動確認する場合のプロジェクトの目標。 私はこのチュートリアルの後にFlexを使用しました。 http://www.adobe.com/devnet/facebook/articles/video_facebook_quick_start.htmlas3フラッシュfacebook:どのサンプルも使えますか?

しかし、私はフラッシュではできませんでした! http://code.google.com/p/facebook-actionscript-api/downloads/list 私が使用するswc shoudlをダウンロードしたとき:mobile/desktop/web?

その後、私はGraphAPI Examples_1_5.zip にしようとした APIエラーコードを得た:191 APIエラー説明:指定されたURLは、アプリケーション エラーメッセージによって所有されていない:REDIRECT_URIがアプリケーションによって所有されていません。

FLASH(フレックスではない)でユーザーを認証するサンプルは使用できますか?

よろしく

答えて

2

は、Googleのコードからダウンロードすることができ、私は同じ問題を持っていたと私は(あまりにも非常に教育されている、)ソースファイルを使用して終了: http://code.google.com/p/facebook-actionscript-api/downloads/detail?name=GraphAPI%20Source_1_5.zip&can=2&q=

例がほとんどのために作られていますFlexまたはAIRを使用することができますが、基本的な知識があれば簡単です。あなたが見ることができるように、あなたは「)getLoginStatus(」二重のコールのようなものを作っている

//--- 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(',')}); 

     } 

んだけど、それはそれなしで動作させることはできません。ここでは例です。私はこれはそれを解決するための最良の方法ではないかもしれないと思うので、誰かがより良い解決策を持っているなら、私はそれをたくさんありがとうと思います:)

+0

..どのように "Facebook"をインポートしますか?私はそれを動作させるようにしようとするが、私はエラーがある "1120:未定義のプロパティFacebookのアクセス" .. –

関連する問題