Javascript ReferenceError:Error#1056:无法在com.facebook.graph.facebook上创建属性com.facebook.graph.core:AbstractFacebook::oauth2

Javascript ReferenceError:Error#1056:无法在com.facebook.graph.facebook上创建属性com.facebook.graph.core:AbstractFacebook::oauth2,javascript,android,facebook,actionscript-3,flash,Javascript,Android,Facebook,Actionscript 3,Flash,首先我想说的是,一年多来我一直在努力让它发挥作用。我试过网上提供的大部分教程。我最终复制了一个我在网上找到的模板,但我仍然无法让它工作。我有一堆文件,我会发布主要的两个。有人能告诉我如何修复此错误消息吗?我不是想剽窃,如果我能让它工作,我可以根据一个工作实例自己工作 MainGameFile.as package { import com.adobe.serialization.json.JSON; import com.facebook.graph.Facebook;

首先我想说的是,一年多来我一直在努力让它发挥作用。我试过网上提供的大部分教程。我最终复制了一个我在网上找到的模板,但我仍然无法让它工作。我有一堆文件,我会发布主要的两个。有人能告诉我如何修复此错误消息吗?我不是想剽窃,如果我能让它工作,我可以根据一个工作实例自己工作

MainGameFile.as

package {
    import com.adobe.serialization.json.JSON;
    import com.facebook.graph.Facebook;

    import flash.display.Loader;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.IOErrorEvent;
    import flash.events.MouseEvent;
    import flash.net.URLRequest;

    public class FlashMobileWeb extends Sprite {

        protected static const APP_ID:String = "647743112027883"; //Your App Id
        protected static const APP_URL:String = "https://localhost:3000/"; 

        protected var profilePic:Loader;

        public function FlashMobileWeb() {          
            var accessToken:String;
            if (loaderInfo.parameters.accessToken != undefined) {               
                accessToken = String(loaderInfo.parameters.accessToken); //get              
    the token passed in index.php
            }

            Facebook.init(APP_ID, onInit, null, accessToken);           

            loginBtn.addEventListener(MouseEvent.CLICK, handleLoginClick, false,  0, true);
            callBtn.addEventListener(MouseEvent.CLICK, handleCallClick, false, 0, true);

            profilePic = new Loader();
            profilePic.contentLoaderInfo.addEventListener(Event.INIT, handleProfilePicInit, false, 0, true);
            profilePic.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, handleProfilePicIOError, false, 0, true);
            profileHolder.addChild(profilePic);
        }

        protected function onInit(response:Object, fail:Object):void {
            if (response) {
                outputTxt.appendText("Logged In\n");    
                loginBtn.label = "Logout";
            } else {
                outputTxt.appendText("Click to Login\n");
                loginBtn.label = "Login";
            }
        }

        protected function handleLoginClick(event:MouseEvent):void {            
            if (loginBtn.label == "Login") {
                var redirectUri:String = APP_URL; //Your App URL as specified in facebook.com/developers app settings
                var permissions:Array = ["user_photos", "user_location"];
                Facebook.mobileLogin(redirectUri, "touch", permissions);
            } else {
                outputTxt.appendText("LOGOUT\n");               
                Facebook.mobileLogout(APP_URL); //Redirect user back to your app url                
            }
        }

        protected function onLogout(response:Object):void {
            loginBtn.label = "Login";
            outputTxt.text = "";
        }

        protected function handleCallClick(event:MouseEvent):void {         
            Facebook.api("/me", onApiCall);
        }

        protected function onApiCall(response:Object, fail:Object):void {
            if (response) {                             
                outputTxt.appendText("RESPONSE:\n" + JSON.encode(response) + "\n"); 


                var req:URLRequest = new URLRequest(Facebook.getImageUrl(response.id, "square"));               
                profilePic.load(req);


                profileHolder.nameTxt.text = response.name + "\n";
                if (response.location != null) { profileHolder.nameTxt.appendText(response.location.name); }


            }
        }   

        protected function handleProfilePicInit(event:Event):void {
            profilePic.x = 1;
            profilePic.y = profileHolder.height - profilePic.height >> 1;
        }

        protected function handleProfilePicIOError(event:IOErrorEvent):void {
            outputTxt.appendText("Error Loading Profile Pic\n");
        }
    }
}
AbstractFacebook.as

package com.facebook.graph.core {

    import com.facebook.graph.data.FacebookSession;
    import com.facebook.graph.net.FacebookRequest;

    import flash.net.URLRequestMethod;
    import flash.utils.Dictionary;

    public class AbstractFacebook {

        protected var session:FacebookSession;
        protected var openRequests:Dictionary;

        public function AbstractFacebook():void {
            openRequests = new Dictionary();
        }

        protected function api(method:String,
                                callback:Function = null,
                                params:* = null,
                                requestMethod:String = 'GET'
                                ):void {

      method = (method.indexOf('/') != 0) ?  '/'+method : method;
            if (session != null) {
                if (params == null) { params = {}; }
                params.access_token = session.accessToken;
            }

            var req:FacebookRequest = new FacebookRequest(
                                            FacebookURLDefaults.GRAPH_URL,
                                            requestMethod
                                            );


            openRequests[req] = callback;

            req.call(method, params, handleRequestLoad);

        }

        protected function handleRequestLoad(target:FacebookRequest):void {
            var resultCallback:Function = openRequests[target];
            if (resultCallback === null) {
                delete openRequests[target];
            }

            if (target.success) {
        var data:Object = ('data' in target.data) ? target.data.data : target.data;
                resultCallback(data, null);
            } else {
                resultCallback(null, target.data);
            }

            delete openRequests[target];
        }

        protected function callRestAPI(methodName:String,
                                    callback:Function = null,
                                    values:* = null,
                                    requestMethod:String = 'GET'
                                    ):void {

             if (values == null) { values = {}; }
             values.format = 'json';

            if (session != null) {
                values.access_token = session.accessToken;
            }

            var req:FacebookRequest = new FacebookRequest(
                                                FacebookURLDefaults.API_URL,
                                                requestMethod
                                                );

            openRequests[req] = callback;

            req.call('/method/' + methodName, values, handleRequestLoad);
        }

        protected function fqlQuery(query:String, callback:Function):void {
             callRestAPI('fql.query', callback, {query:query});
        }

        protected function deleteObject(method:String, callback:Function = null):void {
            var params:Object = {method:'delete'};
            api(method, callback, params, URLRequestMethod.POST);
        }

        protected function getImageUrl(id:String, type:String = null):String {
            return FacebookURLDefaults.GRAPH_URL
                            + '/'
                            + id
                            + '/picture'
                            + (type != null?'?type=' + type:'');
        }
    }
}

除了我用于facebook登录的主代码和抽象的facebook代码之外,我还应该发布哪些其他代码?