0 Replies Latest reply on May 2, 2006 1:40 AM by aljeskica

    Error ocurring when Event Listener methode in "for statement" is called

    aljeskica
      Hy guys,
      I would be gratefull if somebody could answer me how can I call a method from flex in "for statement", that is actually in my remote service implemented. I call the method loadAssetsResult() (event listener method in my action script) and get a collection of objects back. In the same method I want to iterate throught this collection and call another method from remote service, that is specified for this object. Problem is when I call this remote method inside of this loop statement. I get the error when I write my code like following one:

      public function loadAssetsResult(event:ResultEvent):void {
      for (i=0; i<event.result.length; i++) {
      a = new Asset();
      a.longName = event.result .longName;
      a.shortName = event.result
      .shortName;
      a.isin = event.result .isin;
      a.nsin = event.result
      .nsin;
      a.currentDayClose = event.result[0].currentQuote.dayClose; //Schluskurs
      assets.addItemAt(a, i);
      RO.getIndicatorCollection(i);
      }
      DataBinding();
      }

      When I comment the row: RO.getIndicatorCollection() it works, of course without these additional data that I get from that method. I need to call this method inside loop statement (for each object), but I don't know how, without getting this error?


      please somebody help me with some ideas

      br
      Sheila