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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:16:19+00:00 2026-05-29T15:16:19+00:00

I am developing a flash application for a website I have no direct access

  • 0

I am developing a flash application for a website I have no direct access to. The flash application is supposed to call a javascript function on the website, defined by the website publisher. I got advised to check for the existance of the javascript object before calling its’ function from actionscript:

var ok:Boolean = ExternalInterface.call(function() { 
    return typeof customObject !== \'undefined\' 
}

If I then continue with:

if (ExternalInterface.available && ok) {
    ExternalInterface.call('customObject.doSomething', someStr);
}

Will this if’s condition always be false, because the call that gets saved into ok has possibly not finished before I use the check, or is the ExternalInterface.call instantenious? In other words, would I somehow have to wait for the result of the first call before determining if I can savely assume the existance of customObject.

Edit: Updated code as suggested in comments:

if (ExternalInterface.available) {
  var ok:Boolean = ExternalInterface.call('function() { return typeof customObject !== \'undefined\' }');
  if (ok) {
    ExternalInterface.call('customObject.doSomething', someStr);
  } else {
    .. do some fallback
  }
} else {
  .. do some fallback
}
  • 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-29T15:16:20+00:00Added an answer on May 29, 2026 at 3:16 pm

    For robustness, you need to check whether the function is there too:

    var ok:Boolean = ExternalInterface.call(function() {
        if (typeof(customObject) === 'object' && typeof(customObject.doSomething) === 'function') {
            return true;
        }
    }
    

    ExternalInterface.call is synchronous, so you should find that it will wait until this bit is finished until moving on to the next.

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

Sidebar

Related Questions

I'm developing a Flash application which is communicating with Javascript to allow more features
I am developing a flash application required me to have a rotational sprite object
I am developing a flash application in phonegap for android. I have tried to
I am developing a simple flash arcade application but have run into a snag.
I'm a Flash developer but have been slowly moving to developing my applications in
I have been developing in ASP.NET and c#, actionscript flash/flex cs3, and the iPhone.
I am developing a Flex / Flash application which talks to an ASP.Net /
I am currently developing a mobile application using the latest version of Flash Builder
I am developing an application that loads images and video into a Flash player
I'm developing a flash application that is getting information from a remote server using

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.