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 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 61k
  • Answers 61k
  • 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 This line here: void Processor::Process(MyClass ms, const std::string& key) Try… May 11, 2026 at 9:47 am
  • added an answer Both SQL Server and MySql have the Information_Schema.Columns table: http://dev.mysql.com/doc/refman/5.1/en/columns-table.html… May 11, 2026 at 9:47 am
  • added an answer Multiple reasons, and which one is most important differs from… May 11, 2026 at 9:47 am

Related Questions

i have a function which retrieves values from a webservice , then loops through
I have a function which parses one string into two strings. In C# I
I have a function which searches an STL container then returns the iterator when
I have a function which gets a key from the user and generates a
I have a Flex application that calls a function which searches a large document
This is a Windows Forms application. I have a function which captures some mouse
i have a c function which returns a long double . i'd like to
if i have a function A,which can apply a certain rule on a given
Say I have a C function which takes a variable number of arguments: How
I have a simple function in which an array is declared with size depending

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.