This works for me:

   import mx.utils.ArrayUtil;
   var lables : Array = mx.utils.ArrayUtil.toArray(event.result);

-TH

--- In flexcoders@yahoogroups.com, "Greg Morphis" <[EMAIL PROTECTED]>
wrote:
>
> Is there anything special I need to do in returning an array from
CF to Flex?
>
> I've got:
> <cffunction name="getLabels" hint="I return an array of labels"
> access="remote" output="true"  returntype="array">
>
>       <cfset var fooA = arrayNew(1)>
>
>       <cfquery name="fooQ" datasource="budget">
>             select distinct label from main
>             where label != ''
>             order by label
>       </cfquery>
>      
>       <cfset fooA = toArray(fooQ) />
>      
>       <cfreturn fooA />
> </cffunction>           
>
>
> In Flex I can do
> public function handleLabels( event:ResultEvent) :void      {
>       //do whatever neeeded when the result comes back from the WS
>       Alert.show(event.result[2].LABEL);
>       //labels = event.result;
>
> }
>
> And it alerts the correct Label.. but how do I set the event.result
> (which I guess is an Object) to the labels Array?
>
> Thanks!
>






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




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to