Ahh, yes, that does work. I was looping as you suggest, but the
collection change event was firing each time. Now that I think about
it I suppose the best ting to do would be to hook up the event
listener on the last addition to the ac? Or is there a better practice
out there somewhere?

--- In flexcoders@yahoogroups.com, "Michael VanDaniker" <[EMAIL PROTECTED]>
wrote:
>
> I haven't run this code, but I don't see why it wouldn't work:
> 
> this.source = event.result.source;
> 
> I personally prefer looping through the returned collection and
> translating the raw objects into instances of a class I've defined. 
> This allows for compile-time checking on anything you want to do with
> the local copies, and it lets you add methods and properties to those
> objects.
> 
> var o:SomeClass = new SomeClass(event.result[i]);
> collection.addItem(o);
> 
> --- In flexcoders@yahoogroups.com, "Richard Baker" <bishbash64@> wrote:
> >
> > I have a .as class extending arraycollection.
> > 
> > In the constructor I set up a webservice and listner to capture the
> > result in resultHandler
> > 
> > Ideally in resultHandler I'd do something like
> >   this=event.result;
> > 
> > but it doesn't work, so I am looping over the event.result, adding it
> > to the array collection like:
> > 
> >    this.addItem(event.result[i]);
> > 
> > can I assign the whole array collection in one go. Probably missing
> > something simple, but I just can't see it :(
> > 
> > Thx
> >
>


Reply via email to