I was playing around with the examples that came with Flex, and I'm 
encountering something peculiar with RemoteObjectDemo.mxml.

Here is the RemoteObject call:

<mx:RemoteObject id="employeeRO" 
source="samples.explorer.EmployeeManager" 
showBusyCursor="true" result="empList=event.result" fault="alert
(event.fault.faultstring, 'Error')">
    <mx:method name="getList"/>
</mx:RemoteObject>

Notice that the "result" handler simply assigns the return value to a 
variable called "empList". Simple enough.

When I try to display "empList.length", it tells me it's an array of 
2 elements. Still good.

But when I try to do this:

for (var i=0; i<empList.length; i++) // <----- THIS IS LINE 11
{
}

I get the following errors during compilation:

RemoteObjectDemo.mxml    11    Expected an attribute name[xml]
RemoteObjectDemo.mxml    51    Expected end of 
tag 'empList.length'[xml]
RemoteObjectDemo.mxml    52    The input ended before all started 
tags were ended. Last tag started was 'mx:Script''[xml]

I am able to do "alert(empList[0].name);" just fine, so the array is 
good and I can access all data. But it just doesn't like it when I 
use it in a for-loop (!?).

Why is this happening? Does this mean I can't run the array 
of objects returned by the RemoteObject call in a loop?







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
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/

<*> 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