Kyle,

I ran into that problem not too long ago.
I don't know the logic behind it, but it looks like that ArrayCollection
does not like single or null element.

What I end up doing was adding empty elements to my XML and than sending
through filterFunction which filters out the null elements.

Not sure if you can modify the source data or not, but that how I end up
make it work...

Tung Lee

On Thu, May 15, 2008 at 10:02 AM, Kyle Patterson <
[EMAIL PROTECTED]> wrote:

>  Does anyone know how to use an ArrayCollection that just has one element;
> I keep getting a popup error saying "property or method of a null object
> reference".  The ArrayCollection needs to work whether it has one element or
> multiple elements.  Here's my code, what am I doing wrong???
>
>
>
> private var myArrayCollection:ArrayCollection;
>
>
>
> private function myFunc(event:ResultEvent):void
>
> {
>
> if(event.result.blah.blah is ArrayCollection){ //if array has multiple
> elements
>
>       myArrayCollection = event.result.blah.blah;
>
> }else{ //if array has just one element
>
>       var tempAC:ArrayCollection = new ArrayCollection();
>
>       tempAC.addItem(event.result.blah.blah);
>
> }
>
> myArrayCollection = tempAC;
>
> }
>
>
>
> Thanks in advance,
>
>
>
> Kyle
>
> -------------------------------------------------------------
> To unsubscribe from this list, simply email the list with unsubscribe in
> the subject line
>
> For more info, see http://www.affug.com
> Archive @ http://www.mail-archive.com/discussion%40affug.com/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------



-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the 
subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------

Reply via email to