Mike is that a CF limitation?

On Thu, Nov 13, 2008 at 11:24 PM, Mike Duncan <[EMAIL PROTECTED]> wrote:

>   -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I am not quite sure by what you mean "...are not garrunteed that it will
> have the value in the result you expect." There is only one result. And,
> by "dangerous", are you talking about a memory leak or something?
>
> If there is a case when I get no results, then I can understand this
> logic, but in my case, there is always at least one result. A single
> child within the root element of the returned XML that is.
>
> I appreciate the heads up though.
>
> Mike Duncan
> ISSO, Application Security Specialist
> Government Contractor with STG, Inc.
> NOAA :: National Climatic Data Center
> 151 Patton Ave.
> Asheville, NC 28801-5001
> [EMAIL PROTECTED] <mike.duncan%40noaa.gov>
> 828.271.4289
>
> Tracy Spratt wrote:
> >
> >
> > Mike,
> >
> > It is dangerous to use lastResult in this manner:
> >
> > scans = new ArrayCollection([getScan.lastResult.vector.scan]);
> >
> > You are not garrunteed that it will have the value in the result you
> expect.
> >
> > In most cases it will work ok but the correct way is:
> >
> > scans = new ArrayCollection([event.result.vector.scan]);
> >
> >
> >
> > lastResult is intended only for use in binding expressions.
> >
> >
> >
> > Tracy
> >
> >
> >
> > ----------------------------------------------------------
> >
> > *From:* flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>[mailto:
> flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>]
> > *On Behalf Of *Mike Duncan
> > *Sent:* Thursday, November 13, 2008 3:06 PM
> > *To:* flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>
> > *Subject:* Re: [flexcoders] ArrayCollection
> >
> >
> >
> > This is how I got around this...
> >
> > -------------
> > import mx.uils.ObjectProxy;
> > import mx.collections.ArrayCollection;
> >
> > [Bindable] private scans:ArrayCollection;
> >
> > private function handleGetScansResults(event:ResultEvent):void {
> > //Note: getScan is a HTTPService object.
> > if(getScan.lastResult.vector.scan is ObjectProxy) {
> > scans = new ArrayCollection([getScan.lastResult.vector.scan]);
> > }else{
> > scans = getScan.lastResult.vector.scan as ArrayCollection;
> > }
> > }
> > -------------
> > (sorry for any word wrapping)
> >
> > Dunno if someone else already suggested this, but I hope this helps.
> >
> > Mike Duncan
> > ISSO, Application Security Specialist
> > Government Contractor with STG, Inc.
> > NOAA :: National Climatic Data Center
> > 151 Patton Ave.
> > Asheville, NC 28801-5001
> > [EMAIL PROTECTED] <mike.duncan%40noaa.gov> <mailto:
> mike.duncan%40noaa.gov <mike.duncan%2540noaa.gov>>
> > 828.271.4289
> >
> > jch92592 wrote:
> >
> >
> >> All,
> >
> >> I am using an ArrayCollection that I populate with the results from a
> >> ColdFusion RPC.
> >
> >> All works well when there is more than 1 record. When only 1 record is
> >> returned, the data is not assigned to the ArrayCollection.
> >
> >> Any suggestions?
> >
> >> Thank you,
> >> jh
> >
> >
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD4DBQFJHJsonvIkv6fg9hYRAi3+AJd4NApCYammCT/86WCi5lPQvChcAJ47p7Zr
> YEc4klxZno0I7Je3Se73gw==
> =MSe4
> -----END PGP SIGNATURE-----
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED],

Reply via email to