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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:54:12+00:00 2026-06-06T02:54:12+00:00

I have a javascript file which has a function calling a server (url) to

  • 0

I have a javascript file which has a function calling a server (url) to get information. Here is the javascript function:

sendQuery = function(devstr) {

    var baseUrl = 'http://serverurl/' + devstr;

    alert("the url is " + baseUrl);

    $.ajax(baseUrl, {
       type: 'GET',
       dataType: 'json'
    }).done(function(results){
       return results;
    }).fail(function(e) {
       showError(e);
    });
}

and from actionscript I am calling this function as follows:

var result:String = ExternalInterface.call("sendQuery", parameter) as String;

The call actually happens (I got an alert from javascript with the right url) but then result is simply empty or null. There is no result coming back. I added an alert to “done” in javascript and that alert does not get called.

I tried to use ExternalInterface.addcallback but I can’t pass parameters and I am not entirely sure if that will work either.

I am not entirely sure to make the call from Actionscript to the Javascript file, which calls the server, and then get the information back to actionscript so I can parse it and do more with it.

I also should note that some of the operations I will be performing require POST operations. The reason I didn’t do this through actionscript is because it requires having a crossdomain.xml file on the server I am requesting this information from.

Thanks in advance for the help.

  • 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-06-06T02:54:14+00:00Added an answer on June 6, 2026 at 2:54 am

    What you are trying to do, can be done without Javascript in pure ActionScript3.0 by URLLoader class:

     var baseUrl:String = 'http://serverurl/'+parameter;
     var request:URLRequest = new URLRequest(baseUrl);
     request.contentType = 'application/json';
     request.method = URLRequestMethod.GET;    //For 'POST' request-> URLRequestMethod.POST
     var urlLoader:URLLoader = new URLLoader();
     urlLoader.addEventListener(Event.COMPLETE, function(e:Event):void{
         var result:* = e.target.data;
     });
     urlLoader.load(request);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JavaScript file which has a variable as such: var ads =
I have a javascript file which has some code somewhat like this: var Slide
I have a JavaScript file which has a function that I reference. When I
I have a draw.js file with me which has a function as var drawArrow=function(x1,y1,x2,y2)
I have a sample.xhtml file which has few lines of javascript. This javascript will
Suppose I have a Javascript file function js_main(args){ /* some code */ var x
I have a thttpd server set-up which has the following html file. When I
I have a javascript file linked to a PHP page which has a value
I have a file called function.js which has all my jQuery for my aplication
I am new to web development. I have an external JavaScript file which has

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.