Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8356029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:03:07+00:00 2026-06-09T10:03:07+00:00

EDIT : I am trying to do the below LOCALLY I am trying to

  • 0

EDIT : I am trying to do the below LOCALLY

I am trying to do a very simple Facebook implementation for a Flash application. I am using “GraphAPI_Web_1_8_1.swc”. Here is the main Timeline’s code :

import FBLog;
import fanlib.utils.Debug;

addChild(Debug.field); // simply adds a textfield on stage for debugging
FBLog.INSTANCE;

and FBLog Class code:

package {

    import flash.events.Event;
    import flash.events.EventDispatcher;
    import flash.events.MouseEvent;
    import fanlib.utils.Utils;
    import fanlib.utils.Debug;
    import com.facebook.graph.Facebook;

    public class FBLog extends EventDispatcher
    {
        static public const CONNECTED:String = "CONNECTED";
        static public const INSTANCE:FBLog = new FBLog();

        private var _applicationID:String;
        private var _extendedPermissions:Object;

        public function get applicationID():String { return _applicationID; }

        public function FBLog() 
        {
            super();
            if (INSTANCE) throw "What?";

            new DelayedCall(init, 0.5);
        }
        private function init():void {
            _applicationID = "408526019168127";

            //Set permissions to ask for
            _extendedPermissions = {scope:"read_stream, publish_stream, user_about_me, read_friendlists, user_photos"};

            //Initialize facebook
            try {
                Debug.field.appendText("Issuing Facebook init...");
                Facebook.init(_applicationID, handleInit);
                Debug.field.appendText("Issued Facebook init...");
            } catch (e:Error) { Debug.field.appendText("Facebook not initialized!" + "\n" + e); }
        }
        private function handleInit(response:Object, fail:Object):void {
            Debug.field.appendText("end init!");
            if (!response) response = {};
            if (!fail) fail = {};
            trace(Utils.PrettyString(response), Utils.PrettyString(fail));
            dispatchEvent(new Event(CONNECTED));
        }

        public function login(e:MouseEvent = null):void {
            Debug.field.appendText("start login");
            Facebook.login(handleLogin, _extendedPermissions);
        }
        private function handleLogin(response:Object, fail:Object):void {
            Debug.field.appendText("end login");
            if (!response) response = {};
            if (!fail) fail = {};
            Debug.field.appendText(Utils.PrettyString(response) + "\n" + Utils.PrettyString(fail));
            dispatchEvent(new Event(CONNECTED));
        }
    }
}

For some reason that is beyond me, the ‘handleInit’ function in NEVER called. Here is the output that I get in the textfield:

Issuing Facebook init…Issued Facebook init…

I never get the additional “end init!”.

Now, I tried to embed this SWF in an HTML that looks like this, but TO NO AVAIL :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <title>Digital TradeShow</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <style type="text/css" media="screen">
            #myContent              { width:1300 height:700; }
            body                    { margin:0; padding:0; overflow:auto; text-align:center; background:white;}
            #myAlternativeContent   { /* style alt content */ }
        </style>
        <script type="text/javascript" src="swfobject.js"></script>
        <script type="text/javascript">
            var flashvars = {};
            var params = { allowfullscreen:"true", wmode:"window" };
            var attributes = {};
            swfobject.embedSWF("FBLog.swf", "myContent", "1300", "700", "10.2", "expressInstall.swf", flashvars, params, attributes);
        </script>
        <script type="text/javascript">
            function PopupCenter(pageURL,title,w,h,scroll) {
                var left = (screen.width/2)-(w/2);
                var top = (screen.height/2)-(h/2);
                var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars='+scroll+', resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
                } 
        </script> 
        <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
    </head>
    <body>
        <div id="fb-root"></div>
        <div id="myContent">
            <div id="myAlternativeContent">
                <h1>Alternative content</h1>
                <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
            </div>
        </div>
    </body>
</html>

Same output. What could I be doing wrong? The APP_ID I am using is correct.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:03:09+00:00Added an answer on June 9, 2026 at 10:03 am

    This is a very annoying problem and almost “hidden” in the web (at least for me it was very difficult to find the answer).

    In your HTML use this on embed section:

    var attributes = {
        name:"myContent",
        id:"myContent"
    };
    

    When you use the “name” property in the attributes object, the FB JS can find your movie in the DOM tree and execute the callback function.
    Hope this help you.

    Now, I still having a problem: this solves the problem with Chrome, Firefox, etc. But with IE9 no. Probably because a issue with the JSON parser. If i find the answer, i will back and post a link here.

    Cheers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: Updated with suggestions from Bill Karwin below. Still very slow. I'm trying to
edit: I was trying to solve a spoj problem. Here is the link to
I'm trying to edit a form with a ImageField and I´m using modelformset_factory in
I am trying to edit a string of HTML (from a textarea) using jQuery.
I am trying edit the header cell value when using a grid view in
Edit: Updating post based on Martins comments below Hello, I'm just trying to get
Please see edit below I'm trying to dive into OOP development in PHP and
I keep getting the error below when trying to edit any of the data
EDIT: changed the title to fit the code below. I'm trying to retrieve a
I am trying to edit customer with username which is using User.Identity.Name. I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.