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

The Archive Base Latest Questions

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

Good day everybody. I’ve doing a bit of training at working with Flex and

  • 0

Good day everybody.

I’ve doing a bit of “training” at working with Flex and Remote Data from XML files.

This is my HTTPService

<mx:HTTPService id="loginData" url="com-handler/basic.xml" showBusyCursor="true">
</mx:HTTPService>

I have a button and when its clicked its call a function, that calls loginData.send and does a little IF condition, that IF condition relies on the data returned by loginData.

The condition doesn’t work because its called right next to the loginData.send, and .send method still didn’t returned the values from the XML file. But if you click it a second time a second after the first click the IF condition works.

So to deal with i wanted to do a eventListener so that when loginData.send returned the data from the XML it fires up the IF condition. But i don’t know how to do it.

Can you help me?

  • 1 1 Answer
  • 1 View
  • 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-12T13:39:11+00:00Added an answer on May 12, 2026 at 1:39 pm

    The send method of HTTPService returns an AsyncToken, to which you can add a Responder, as well as arbitrary data. So in the click handler of your Button:

    var responder:IResponder = new Responder(myResultFunction, myFaultFunction)
    var token:AsyncToken = myService.send();
    token.addResponder(responder);
    

    Additionally, the MXML can declare a result handler:

    <mx:HTTPService id="myService" result="myResultHandler(event)"/>
    

    One interesting aspect of AsyncToken is that it is a dynamic object, meaning you ca apply arbitrary properties to it:

    var responder:IResponder = new Responder(myResultFunction, myFaultFunction)
    var token:AsyncToken = myService.send();
    token.addResponder(responder);
    token.myArbitraryProperty = "Whatever";
    token.anotherProperty = someObject;
    

    Now, in the myResultFunction you can access event.token.myArbitraryProperty for use in conditionals or whatever you may need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day everybody, I'm having troubles with the display of a data that does
Good day, Stack Overflow. I have a homework assignment that I'm working on this
Good day, I'm puzzled a bit with this: In[1]:= f[x_]:=With[{xx=x},f[xx_]:=ff[xx]] DownValues[f] f[1] DownValues[f] Out[2]=
INITIAL ISSUE Good day everybody, I've already found several algorithms to do this task.
Good Day, Can someone confirm what was said at the bottom of this post
Good day I have a custom TextBox that has a IndicatorTextBox.ui.xml file as well
Good day, I try to start new Activity from another. But it always crashed.
Good day, all. I know that this is a pretty basic question in terms
Good Day, I have a simple working routine in Perl that swaps two words:
Good day! I want to add and remove CSS files according to the size

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.