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 6231387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:55:34+00:00 2026-05-24T09:55:34+00:00

I have an AS3 application that shows users tweets. I’m trying to use the

  • 0

I have an AS3 application that shows users tweets. I’m trying to use the twitter intents links to do popups, such as https://twitter.com/intent/retweet?tweet_id=93035636432437248.

When you have a simple href=”link” it will use the embedded http://platform.twitter.com/widgets.js to properly format a nice popup window.

When in flash I can only open in self or blank and neither triggers the JavaScript the same way it does when you click from html href links.

I also tried using ExternalInterface to call a js method to use document.location or window.open and neither used the twitter js.

What is the best way to harness the Twitter JavaScript from a flash button so we get the nice clean popup window?

  • 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-24T09:55:35+00:00Added an answer on May 24, 2026 at 9:55 am

    Looking at the Twitter Web Intents API Documentation, near the bottom of the page you can find a link to the unobfuscated source code which shows how their API automatically handles links.

    Put simply they are attaching a Click Event Handler to the DOM which then checks to see if the link being clicked points to their Web Intents URL. As you are opening a window from ActionScript you are bypassing the DOM and therefore the code won’t fire.

    Now normally you would just expect to use ExternalInterface to call a method exposed by the Web Intents API; however the clever chaps at Twitter have created their entire API in an anonymous closure to avoid polluting the DOM – gotta love javascript 😉

    So, personally, I would tackle this by creating my own version of the Twitter Web Intents API and including it on the HTML page which my Flash Application sits; for example:

    // Create a global object which we can attach methods to.
    var TwitterAPI = {};
    
    // The methods themselves are created in a closure to avoid polluting the global
    // namespace with temporary variables.
    (function() {
        // The base URL of the Twitter API.
        TwitterAPI.baseURL = "https://twitter.com/intent/";
    
        // Opens a pop-up window and prompts the user to retweet the Tweet linked to 
        // the supplied tweet_id.
        TwitterAPI.retweet = function(tweet_id) {
            var url = TwitterAPI.baseURL + "retweet?tweet_id=" + tweet_id;
            openWindow(url);
        }
    
        function openWindow(url) {
            var windowOptions = "scrollbars=yes,resizable=yes,toolbar=no,location=yes";
            var width = 550;
            var height = 420;
    
            // Center the popup window.
            var left = Math.round((screen.width / 2) - (width / 2));
            var top = 0;        
            if (screen.height > height) {
                    top = Math.round((screen.height / 2) - (height / 2));
                }
    
            window.open(url, 'intent', windowOptions + ",width=" + width +
                ",height=" + height + ",left=" + left + ",top=" + top);
    
        }
    }());
    

    You can then invoke this from your ActionScript project via an ExternalInterface call, as you previously suggested:

    ExternalInterface.call("TwitterAPI.retweet", "35782000644194304");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK We have a Adobe Air (AS3) application that runs our WPF application. but
I have started developing a drawing application in as3. I am thinking that I
I have a Flash AS3 application that uses FileReference.browse() to request a SWF from
We have a Flash app (AS3). This is a desktop application that runs in
I have an AS3 application that loads various SWFs at runtime. The loading animation
i have a AS3/FL10 based application that renders/animates/filters (blur) large PNGs (1 per view)
We have a projector application (.exe) compiled from AS3. How can we start another
I have a AS3 swf [1] that is loading another AS2 swf [2] which
I have an AS3 class with some getVideo function. I want to use this
I have a flash map application that I want to rebuild on the new

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.