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

  • Home
  • SEARCH
  • 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 3952788
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:53:48+00:00 2026-05-20T01:53:48+00:00

I am getting a ‘swf is null’ in the Firebug console when calling Facebook.login(handleLogin,

  • 0

I am getting a ‘swf is null’ in the Firebug console when calling Facebook.login(handleLogin, {perms:”user_photos, publish_stream”}) using the Facebook Adobe Actionscript 3 1.5 Graph API. Not sure what the issue is, but here is the AS3 Code:

  package alvincrespo
  {
    import flash.display.MovieClip;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.external.ExternalInterface;
    import flash.text.TextField;
    import fl.controls.Button;
    import flash.utils.Timer;
    import flash.events.TimerEvent;

    //-----------------------
    //Facebook Classes
    import com.facebook.graph.Facebook;
    import com.facebook.graph.data.FacebookSession;
    import com.facebook.graph.net.FacebookRequest;
    //-----------------------

    public class Main extends MovieClip
    {

      public var btn_login              :Button;
      public var txt_status             :TextField;
      private var APP_ID                :String = ""; //put in the app id here


      public function Main():void
      {
        trace("Main");
        btn_login.addEventListener(MouseEvent.CLICK, handleLoginClick);
        Facebook.init(APP_ID, handleInit);
      }

      private function handleInit(response:Object, fail:Object):void
      {
        trace("Main :: handleInit");
        if(response)
        {
          changeToLoginState();
        }
        else
        {
          trace("Main :: handleInit : Did not Init!")        
        }
      }

      private function handleLogin(response:Object, fail:Object):void
      {
        trace("Main :: handleLogin");
        if(response)
        {
          changeToLoginState();        
        }
        else
        {
          trace("Main :: handleLogin : Did not Log In!")
        }
      }

      private function handleLogout(success:Boolean):void 
      {
        trace("Main :: handleLogout");
        btn_login.label = 'Login';
        txt_status.text = "Logged Out";
      }

      private function handleLoginClick(evt:MouseEvent):void
      {
        trace("Main :: handleLoginClick");
        if(Facebook.getSession() == null || Facebook.getSession().accessToken == null)
        {
          trace("Main :: handleLoginClick : if");
          var fbLoginTimer:Timer = new Timer(1000, 1);
              fbLoginTimer.addEventListener(TimerEvent.TIMER_COMPLETE, doFBLoginTimerComplete);
              fbLoginTimer.start();
        } 
        else 
        {
          trace("Main :: handleLoginClick : else");
          Facebook.logout(handleLogout);
        }
      }

      private function changeToLoginState():void 
      {
        trace("Main :: changeToLoginState");
        btn_login.label = 'Logout';
        txt_status.text = "Logged In";
      }

      private function handleSessionChanged(success:Object, fail:Object):void 
      {
        trace("Main :: handleSessionChanged");
        changeToLoginState();
      }    

      private function doFBLoginTimerComplete(evt:TimerEvent):void
      {
        trace("Main :: doFBLoginTimerComplete");
        evt.target.stop();
        Facebook.login(handleLogin, {perms:"user_photos, publish_stream"});
        /*Facebook.callJS('redirect', {perms:"user_photos, publish_stream"});*/
      }
    }
  }

And here is the HTML

    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <title>Page Title</title>
        <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
    </head>
      <body>
        <div id="FlashDiv">
          <h1>You need at least Flash Player 9.0 to view this page.</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>
        <script type="text/javascript">
          function redirect() 
          {
            alert("redirect");
           var params = window.location.toString().slice(window.location.toString().indexOf('?'));
           top.location = 'https://graph.facebook.com/oauth/authorize?client_id=&scope=email,publish_stream,offline_access,read_stream&redirect_uri=http://apps.facebook.com/someapp' + params;
          }

            $(document).ready(function(){
                swfobject.embedSWF("main.swf", "FlashDiv", "550", "400", "10");
            });
        </script>
      </body>
    </html>

Really not sure what the issue is. Any help, would be great! Thanks!

  • 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-05-20T01:53:49+00:00Added an answer on May 20, 2026 at 1:53 am

    Basically, you need to set the name and ID of the object tag, you can do that easily with SWFObject as you can see below. You also need to have the appropriate allowscriptaccess attribute set.

        <!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></title>
                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
            <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
            <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
            <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
                <script type="text/javascript">
                    var flashvars = {};
                    var params = {};
                    params.allowscriptaccess = "sameDomain";
                    var attributes = {};
                    attributes.id = "FlashDiv";
                    attributes.name = "FlashDiv";
                    swfobject.embedSWF("main.swf", "FlashDiv", "550", "400", "10.0.0", "expressInstall.swf", flashvars, params, attributes);
                </script>
            </head>
            <body>
                <div id="FlashDiv">
                    <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>
                </div>
            </body>
        </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Getting red warning message that expected identifier for this statement CALayer = ImageView.layer; Using
Getting a strange error when trying to insert data into an Access database using
Getting started with python. I am trying to implement positional index using nested dictionary.
Getting Fatal Error while running bin/hadoop namenode -format Using Windows 7 operating system, Under
Getting java.io.EOFException while sending a large java object using AciveMQ. Below is the large
getting errors when trying to write into a SQL database using the 2 following
Getting an error if using Apache Commons Validator: java.lang.NoClassDefFoundError: org/apache/oro/text/perl/Perl5Util Even if, Apache Commons
Getting Response is null error while receiving HTTP response. I am developing an sample
Getting a weird error box when using the 64bit version of adobepdf ifilter for
Getting started with using Vagrant for some Rails development. Going one step at a

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.