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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:17:25+00:00 2026-05-25T06:17:25+00:00

How can I return a value from AS3 to javascript. I am calling a

  • 0

How can I return a value from AS3 to javascript. I am calling a AS3 method from JS and want that AS3 method to return back a string:

//javascript
var string = swfObject["abcmethod"](arg1);

The only way I know of is to add a callback method which is called from flash back in JS. Is there a better way?

  • 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-25T06:17:26+00:00Added an answer on May 25, 2026 at 6:17 am

    The communication pipe between AS3 and Javascript does support passing a value back to the Javascript function called. It’s in the docs:

    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html

    Using the ExternalInterface class, you can call an ActionScript
    function in the Flash runtime, using JavaScript in the HTML page. The
    ActionScript function can return a value, and JavaScript receives it
    immediately as the return value of the call.

    If the code you have isn’t working, try using a different syntax. The following is what I usually use:

    var myFlashObject = document.getElementById("theIdYouSuppliedToSwfObject");
    var myResult = myFlashObject.abcmethod(arg1);
    

    Your code in actionscript should be something like:

    ExternalInterface.addCallback("abcmethod", onAbcMethodCall);
    private function onAbcMethodCall(...args:Array):String
    { return "Hello World"; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a generic method that can return a value parsed from a string
I'm trying to return a value from (transport) to the calling function, but can't
Can we return null value from stored procedure. i dont want to use collase
If we want to get a value from a method, we can use either
How can I return a value from ShowStatus elapsed event? Here is my code.
In order to return a value from a VB.NET function one can assign a
I'm having a hard time understanding why I can't assign a return value from
I want to know if its possible to get the return value from batch
How can I return the value pinNumber from jquery ajax so I can append
How can I use try/catch/finally to make sure that the function will return value?

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.