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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:35:19+00:00 2026-05-25T16:35:19+00:00

I am calling an ActionScript object method from within a JavaScript function, however I

  • 0

I am calling an ActionScript object method from within a JavaScript function, however I can’t be sure the flash object has that particular method. If the flash object does not supply the method in question I end up with an Error calling method on NPObject!.

How can I check whether the flash object supplies the method in question? I tried to wrap it in a type check like this:

if(typeof flashObj.myfunction() === 'function') {
    //do it
}

But I still end up with:

Error calling method on NPObject!
if(typeof flashObj.myfunction() === 'function') { 
…

Thank you!

  • 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-25T16:35:20+00:00Added an answer on May 25, 2026 at 4:35 pm

    You are actually calling the function in your comparison.

    Instead of this:

    if(typeof flashObj.myfunction() === 'function') {
        //do it
    }
    

    use this:

    if(typeof flashObj.myfunction === 'function') {
        //do it
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little test swf to test calling an ActionScript(3.0) function from JavaScript.
Calling Validate() on an XmlDocument requires passing in a ValidationEventHandler delegate. That event function
im calling an actionscript class from my main mxml file. the actionscript class is
I have an AS2 Flash SWF that is calling another AS2 Flash File using
Code inside Actionscript: var methodName4:String = startupload; var instance4:Object = null; var method4:Function =
I'm calling FFmpeg via ProcessStartInfo inside my C# application however, I can't keep getting
When calling CoInitializeEx , you can specify the following values for dwCoInit : typedef
I am trying to enable communication between Javascript and Flash via ExternalInterface across domains.
I have a Flash sprite in my Director project. Under the Properties of that
I'm using AMFPHP 1.9, ActionScript 3 and Adobe Flash Pro CS5 with Flash player

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.