Hi Keit,
Yes. That's what I wrote. My point is to make understanding clear that why
is it like this?
The code that I have written is working. And if so, how can MXML get
compiled if I refer username and/or password field from us (us:Object!)?
username & password are public fields of User class (of ActionScript).
The code is working. Just wanted help, if someone can clarify reason behind
this.
Regards,
Harit
www.printgreener.com - Millions of trees can't be wrong - please think twice
before printing.
On Sat, Nov 1, 2008 at 5:30 PM, kiet tuan <[EMAIL PROTECTED]> wrote:
> Hi Harit,
> You can not cast res.getItemAt(0) to User object.
> you only use using us:Object = res.getItemAt(0);
>
> I tested already on .NET
>
> Regards,
> KietVT
>
> 2008/11/1 harit <[EMAIL PROTECTED]>
>
>
>> I have implemented a web service that returns ArrayList (Java) object
>> from AXIS + apache tomcat server.
>> I have implemented a method for my flex client to manipulate result of
>> the WS call.
>> Here it is...
>>
>> public function resEvent(event:ListUsersResultEvent):void
>> {
>> var res:ArrayCollection = (ArrayCollection)(event.result);
>> var us:Object = res.getItemAt(0);
>> mx.controls.Alert.show(""+us.password + " " + us.id);
>> }
>>
>> For ref. the java web service on server is returning ArrayList of User
>> objects.
>> I have User ActionScript class on client too.
>>
>> Everything's fine except that when I typecast var us:User = (User)
>> (res.getItemAt(0)); it gives exceptions.
>> Just declaring and assigning by var us:Object = res.getItemAt(0);, I
>> am able to access public properties like id, password which are
>> essentially belong to User class and not Object class.
>>
>> Can anyone explain reason behind this? FYI : The above method is
>> perfectly working without any compile / runtime error!
>>
>> Thanks,
>> Harit
>>
>>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---