Thanks Mike.... That really opened my eyes and helped me understand..
>>countries = event.result. countries as ArrayCollection; > > In ColdFusion all queries are returned as a true ArrayCollection objects, > so you don't need to create your own. So with this syntax you are just > casting, or telling the compiler, the variable that you already know the > datatype of (ArrayCollection) is an real ArrayCollection. > >>countries = new ArrayCollection(event.result.countries as Array); > > Here you are telling the compiler the result is an Array, so you need to > *create* a new ArrayCollection object based on this array. > > hth, > ---nimer > > ----- Original Message ---- > From: jtooley_1999 <[EMAIL PROTECTED]> > To: [email protected] > Sent: Friday, July 28, 2006 2:03:28 AM > Subject: [flexcoders] ArrayCollection > > Hi all, > > I am banging my head against the wall on this one. > > We have an app that runs on two different servers. > One calls a CFC and uses <mx:RemoteObject> > The other one calls a java servlet using <mx:HTTPService> but they both > retrieve the same data. > > With the CFC we are using remoting and we can access the data by going > > public function geoResultHandler( event:ResultEven t):void > { > countries = event.result. countries as ArrayCollection; > // difference > blah blah blah... more code > } > > and to call it > <mx:ComboBox id="theCountry" x="10" y="58" prompt="Please Select A > Country" dataProvider= "{countries} " labelField=" country_long" > change="setProvince ()" width="90%"> > > This works great..... > > But with <mx:HTTPService> .. using that way returns null.. so we have to > use the following > > public function geoResultHandler( event:ResultEven t):void > { > countries = new ArrayCollection( event.result. countries > as Array); // difference > blah blah blah... more code > } > > <mx:ComboBox id="theCountry" x="10" y="58" prompt="Please Select A > Country" dataProvider= "{countries} " labelField=" country_long" > change="setProvince ()" width="90%"> > > Can anyone explain the difference of using a variable as an > ArrayCollection instead of declaring new ArrayCollection( ) > > Thanks > Jeremy Tooley > > > Jeremy Tooley Creative Director We Made That Design Group Inc. [EMAIL PROTECTED] http://www.wemadethat.com p: 403.668.0857 c: 403.836.3048 -- 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/

