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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:46:21+00:00 2026-05-16T15:46:21+00:00

I’m developing a Flex application and am having some trouble working with asynchronous calls.

  • 0

I’m developing a Flex application and am having some trouble working with asynchronous calls. This is what I would like to be able do:

[Bindable] var fooTypes : ArrayCollection();

for each (var fooType : FooType in getFooTypes()) {
    fooType.fooCount = getFooCountForType(fooType);
    itemTypes.addItem(fooType);
}

The issue I’m running into is that both getFooTypes and getFooCountForType are asynchronous calls to a web service. I understand how to populate fooTypes by setting a Responder and using ResultEvent, but how can I call another service using the result? Are there any suggestions/patterns/frameworks for handling this?

  • 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-16T15:46:21+00:00Added an answer on May 16, 2026 at 3:46 pm

    If possible, I Strongly recommed re-working your remote services to return all the data you need in one swoop.

    But, if you do not feel that is possible or practical for whatever reason, I would recommend doing some type of remote call chaining.

    Add all the “remote calls” you want to make in array. Call the first one. In the result handler process the results and then pop the next one and call it.

    I’m a bit unclear from your code sample when you are calling the remote call, but I assume it part of the getFooCountForType method. Conceptually I would do something like this. Define the array of calls to make:

    public var callsToMake : Array = new Array();
    

    cache the currently in process fooType:

    public var fooType : FooType;
    

    Do your loop and store the results:

    for each (var fooType : FooType in getFooTypes()) {
        callsToMake.push(fooType);
        // based on your code sample I'm unclear if adding the fooTypes to itemTypes is best done here or in the result handler
        itemTypes.addItem(fooType);
    }
    

    Then call the remote handler and save the foo you’re processing:

    fooType = callsToMake.pop();   
    getFooCountForType(fooTypeToProcess);
    

    In the result handler do something like this:

    // process results, possibly by setting 
    fooType.fooCount = results.someResult;
    

    and call the remote method again:

    fooType = callsToMake.pop();   
    getFooCountForType(fooTypeToProcess);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to count the length of a string with PHP. The string
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,

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.