--- In [email protected], Robert Moss <rdm0...@...> wrote:
>
> Yes use a third if statement like:  if(event.result.categories)   
> if(event.result.categories != null) should also work
> 
> Notice I used event.result instead of LinksService.lastResult.  Small change, 
> but you should get in the habit as LinksService.lastResult will cause some 
> pain in the future if you decide to change it's name for some reason.  
> 
> Amy suggested using e4x which is probably the correct answer as e4x grants 
> you consistency ( you do not have the arrayCollection returned sometimes and 
> ObjectProxy others) and allows you to work with XML in actionscript like XML 
> was meant to be accessed.  You will still have to trap for the same issues, 
> just implemented in a different way.   We do not always use e4x although we 
> probably should, being lazy will probably bite us one of these days.

I think you've misunderstood.  By changing the result format from the default 
of object to e4x, you _avoid_ the problem the OP had, which is if there is only 
one object returned, you get a different result than if you have multiple 
objects returned.  You don't have to trap for the problem, because it goes 
away.  If there is only one node, you get one node.  If there are multiple 
nodes, you get multiple nodes.

But whatever.

-Amy

Reply via email to