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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:03:23+00:00 2026-05-11T02:03:23+00:00

i have a function which retrieves values from a webservice , then loops through

  • 0

i have a function which retrieves values from a webservice , then loops through the returned values and for each returned value does another webservice lookup.

Im having a problem however that when i make the second webservice call within the for loop that the function does not wait for the reuslt and just keeps processing and in turn giving me no value

the code looks like this;

    private function getResult(e:ResultEvent):void{     var lengthOfResult:int = e.result.length;    var arrayCollResults:ArrayCollection = new ArrayCollection();    var resultArray:Array = new Array(e.result);         for(var i:int = 0 ; i < lengthOfResult; i++){       var currentName:String = e.result[i].toString();       arrayCollResults.addItem(e.result[i] + ws.getMatches(currentName));     }     acu.dataProvider = arrayCollResults;    } 

what can i do to insure that the value of ws.getMatches(currentName) actually returns a value before moving to next line?

  • 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. 2026-05-11T02:03:23+00:00Added an answer on May 11, 2026 at 2:03 am

    The documentation here indicates that you do not call the Web service directly, you need to set up an event listener and handle the response on completed delivery.

    From the section ‘Calling web services in ActionScript’:

    <?xml version='1.0'?> <!-- fds\rpc\WebServiceInAS.mxml -->  <mx:Application xmlns:mx='http://www.adobe.com/2006/mxml'>     <mx:Script>         <![CDATA[         import mx.rpc.soap.WebService;         import mx.rpc.events.ResultEvent;         import mx.rpc.events.FaultEvent;         private var ws:WebService;         public function useWebService(intArg:int, strArg:String):void {             ws = new WebService();             ws.destination = 'echoArgService';             ws.echoArgs.addEventListener('result', echoResultHandler);             ws.addEventListener('fault', faultHandler);             ws.loadWSDL();             ws.echoArgs(intArg, strArg);         }          public function echoResultHandler(event:ResultEvent):void {             var retStr:String = event.result.echoStr;             var retInt:int = event.result.echoInt;          //Do something.         }          public function faultHandler(event:FaultEvent):void {       //deal with event.fault.faultString, etc         }         ]]>     </mx:Script> </mx:Application> 

    Put the ‘arrayCollResults.addItem(…)’ segment in the result handler for your ws.getMatches() event.

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

Sidebar

Ask A Question

Stats

  • Questions 74k
  • Answers 74k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Not quite sure what you are after here but here… May 11, 2026 at 2:30 pm
  • added an answer If you are updating your div with an ajax-call, a… May 11, 2026 at 2:30 pm
  • added an answer It is, of course, possible to use InstantDjango for development.… May 11, 2026 at 2:30 pm

Related Questions

I am having some trouble with one of my ASP.NET 2.0 application's connection string.
I have a table with about 2,000,000 rows. I need to query one of
I am a mySQL noob, and have a slightly stupid question... I am using
I tried changing a default parameter value with this: ALTER PROCEDURE [dbo].[my_sp] @currentDate datetime

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.