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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:48:58+00:00 2026-05-25T23:48:58+00:00

I tried to call a flash callback method from JavaScript. But it seems not

  • 0

I tried to call a flash callback method from JavaScript.
But it seems not working.
The flash action script example code is like below [Simplified]:

import flash.events.ActivityEvent; 
import flash.events.StatusEvent; 
import flash.external.ExternalInterface;

var test_var = ExternalInterface.addCallback("js_method_to_call", flash_method);


function flash_method()
{   
  return "test"; 
}

The javascript example code is written below [Simplified]:

 function callFlashMethod(){
   var flashFile = eval("window.document.test");
   flashFile.js_method_to_call;
 }
 function loadTest(){
   swfobject.embedSWF("test.swf", "test", "1", "1", "10.0.0", false);
 }

 $(document).ready(function(){
   loadTest();
   callFlashMethod();
 });

It is always display the error in fire bug console “flashFile.js_method_to_call is not a function”.

  • 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-25T23:48:58+00:00Added an answer on May 25, 2026 at 11:48 pm

    Here’s something that should work really good:

    1. Use SWFObject.js for embedding the Flash content:

      // Embedding through SWFObject rocks in comparison with Adobe shits:
      var flashvars = {};
      
      var params                  =   {};
      params.menu                 =   "false";
      params.salign               =   "t";
      params.scale                =   "noscale";
      params.wmode                =   "transparent";
      params.allowScriptAccess    =   "always";
      
      var attributes              =   {};
      attributes.id = "${swf}";
      
      swfobject.embedSWF("${swf}.swf", "flashDiv", "${width}", "${height}", "9.0.0", "", flashvars, params, attributes);
      
    2. Use this for the HTML:

      <body>
          <div id="flashDiv"></div>
      </body>
      
    3. To call your Flash method use this pattern:

      // Functions needed for calling Flex ExternalInterface
      function thisMovie(movieName) 
      {
          if (navigator.appName.indexOf("Microsoft") != -1) 
          {
              return window[movieName];
          } 
          else 
          {
              return document[movieName];
          }
      }
      
    4. Call the Flash method:

      function callFlashMethod()
      {
          thisMovie("${swf}").js_method_to_call();
      }
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to call a c# function from JavaScript - I want to pass
How to create a generic method which can call overloaded methods? I tried but
This seems really easy, but it's definitely not working as expected. In WPF 4.0,
I'm trying to have JavaScript call a function from my ActionScript. ActionScript: import flash.external.ExternalInterface;
I want to ask,i tried to call webapp.RequestHandler ,but this handler didn't called: this
I am trying datatables. I successfully tried on ajax call. But now I am
Hi i want to call a C# method.. I already tryed with webmethod, but
I'm communicating from a flash application using a command like the following: ExternalInterface.call(hello, world)
I tried to call a service using a for loop and it seems that
I am using the following AS code to call a javascript function which will

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.