I was hoping that turning a query into an array via a result handler
was such a common practice that someone could quickly set me straight

For the record I get  compiler errors on this line
public var cities:IList = new
ArrayCollection({mx.utils.ArrayUtil.toArray(result)});

of
Expecting colon before dot
Expecting primary expression before rightbrace
Expecting rightbrace before semicolon

I attempted to what had worked in AS2

private var myObj:Object = result;
private var cities:Array = new Array;
private var i:Number = 0;
for (i=0; i<myObj.length; i++) 
        {
                cities.push({CITY:myObj.getItemAt(i)}) 
                
        }

and got runtime error  Error #1006:
 Call attempted on an object that is not a function.


--- In [email protected], Manish Jethani
<[EMAIL PROTECTED]> wrote:
>
> On 11/18/05, yaagcur <[EMAIL PROTECTED]> wrote:
> 
> > My attempts to date have ended in failure
> 
> What kind of failure?  When you report that something "isn't working",
> please also explain what you mean by that.  Compiler error?  Runtime
> error?  Nothing Happens (TM)?
> 
> > public function citiesResultHandler(result:Object) {
> >
> > public var myIList:IList = new
> >
ArrayCollection({mx.utils.ArrayUtil.toArray(ContactService.getCities.result)});
> >
> > // The function to change the collection, and therefore the Array.
> > myIList.addItemAt("All Cities", 0);
> >
> > }
> >
> > Any chance you could point out the errors in the above function
> 
> I believe that's the compiler's job (AS3 is "strongly typed" and all
> that jazz for a reason) :)
> 
> Okay, honest, I don't know much about the collection API, but I know
> you have to add an item to the collection (the list's "dataProvider"
> property).  You have the documentation.  Good luck!
> 
> Manish
>








------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/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