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

  • Home
  • SEARCH
  • 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 4112556
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:12:39+00:00 2026-05-20T22:12:39+00:00

Im trying to make a HTTP Request in Adobe Flex (Actionscript) as follows: var

  • 0

Im trying to make a HTTP Request in Adobe Flex (Actionscript) as follows:

var p:PersonSearchController = new PersonSearchController();
showAlertDialog();
p.search(sc);
alert.cancel();

navigator.pushView(views.PersonSearchResults, +p.getResp());

So basically, before the search we get a “Searching…” AlertDialog box, once the search is complete, the dialog box disappears and the results screen is pushed onto the screen…

Here is the search method:

function search{
var requestSender:URLLoader= new URLLoader();

dispatcher.addEventListener(Event.COMPLETE, completeHandler);

var urlRequest :URLRequest = new URLRequest("http://airpoint05:8888/MPS2/PersonSearch");

var msg:String = "blah";

/* Setup HTTP Request */
urlRequest.data = msg;
urlRequest.contentType = "application/x-www-form-urlencoded";
urlRequest.method = URLRequestMethod.POST;
requestSender.load(urlRequest);
}

And here is the completeHandler function:

/* URL has completed and got a response */
private function completeHandler(event:Event):void
{
    var response:URLLoader = URLLoader(event.target);
    this.res = URLLoader(event.target).data;
    trace(this.res);
    response.close();   
}

When this line is called: navigator.pushView(views.PersonSearchResults, +p.getResp());

p.getResp() is nothing as the response hasn’t came back yet. I want the program to basically block until the HTTPResponse is received so I can process the results. At the moment the Popup appear and disappears quickly, and in the background the search goes off and makes the request… I get the response but only after the results screen has been pushed out. How can I make the popup block until we have a HTTPresponse?

Thanks
Phil

  • 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-20T22:12:40+00:00Added an answer on May 20, 2026 at 10:12 pm

    Don’t use URLLoader for this, use HTTPService:

    <fx:Script>
    <![CDATA[
    private function search(text:String):void
    {
    service.send({search:text}); // your service will receive the variable 'search' with your string
    }
    
    private function resultHandler(e:ResultEvent):void
    {
    var data:Object = e.result;
    // do whatever else here
    }
    ]]>
    </fx:Script>
    <s:HTTPService id="service" method="POST" url="http://airpoint05:8888/MPS2/PersonSearch" result="resultHandler" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a http request. The code looks like this: NSString *urlString
I am trying to make an HTTP request in Python 2.6.4, using the urllib
I'm trying to make an HTTP Get request using JQuery, but I get an
I'm trying to make a simple HTTP POST request, and I have no idea
I am trying to make a get http request using jquery getJSON function. I
I am trying to make Http connections made by C# HttpClient helper class reusable.
I am trying to make an Http POST to an Apache web server. I
Trying to make a make generic select control that I can dynamically add elements
Trying to make a MySQL-based application support MS SQL, I ran into the following
Trying to make a generic PL/SQL procedure to export data in specific XML format,

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.