event.result must not be an array. when you are assigning it "as
Array" it is returning null.

use the debugger to determine the actual datatype of event.result. I
would guess it is an ArrayCollection, not an Array. But it could be
some other kind of list or object too. (XMLList, etc). Hard to tell
without knowing where the data is coming from.

Thunder


--- In flexcoders@yahoogroups.com, "Greg Morphis" <[EMAIL PROTECTED]> wrote:
>
> I'm playing around with a remote object and in the handleResult
> function Flex is giving me this 1009 error when I try to refer to the
> variable I assigned to the event.result.
> If I do Alert.show(event.result[0].QUESTION.toString()); then I get
> the right result.
> However if I assign event.result to a variable, I get the error..
> myData = event.result as Array;
> Alert.show(myData.length.toString());
> bombs with the error
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
> 
> Here's my code..
>             [Bindable]
>             public var myData:Array = new Array();
> 
>             public function handleResult( event : ResultEvent ) :
void    {
>                 myData = event.result as Array;
>                 Alert.show(myData.length.toString());
>                 //Alert.show(event.result[0].QUESTION.toString());
>             }
> 
> So what's Flex whining about? myData is declared, it's assigned.. it
> should work?
> 
> Thanks!
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to