So something like ......: 
 
[Bindable]

private var photoFeed:XML;

private function photoResultHandler(event:ResultEvent):void
{

   photoFeed = event.result as XML;
}
 

<mx:HTTPService 

        id="photoService"

        url="http://api.flickr.com/services/feeds/photos_public.gne"; 

        resultFormat="e4x"

        result="photoResultHandler(event);"

        fault="photoFaultHandler(event);"

    />
 
And you also state:
 
You wrap the XMLList in an XMLListCollection:
Var xlcResult:XMLListCollection = new XMLListCollection(xlResult)
 
I dont understand how this is better. I'm not disputing it. I just dont
understand. 
What will this enable me to do that I'm not doing now? (Again, I'm
asking to understand, not to dispute)
 
If you just want to give me a reading list thats fine too.


thanks for your time.
 
brad
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Wednesday, February 06, 2008 4:42 PM
To: [email protected]
Subject: RE: [flexcoders] Re: Embedding String Variable in dataprovider
name






Yes, binding to lastResult is, as you are seeing, hard to debug.  Use a
result handler.

Tracy




  _____  


From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of jer_ela
Sent: Wednesday, February 06, 2008 9:34 AM
To: [email protected]
Subject: [flexcoders] Re: Embedding String Variable in dataprovider name



For the immediate problem, add some code to the function that checks
the first parameter for null, and returns a null value of the
appropriate type in that case.

But for a more robust application, you should stop using lastResult.
Direct use of lastResult is really only appropriate for prototyping.
You are much better off using a result handler to process the result,
handling the special cases, and putting the appropriate values into
variables that you then use for the binding.

--- In [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com>
ups.com, "Brad Bueche" <[EMAIL PROTECTED]> wrote:
>
> This gets rid of the data binding waring but then the chart itself
blows
> up saying its getting null objects.
> 
> brad
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com>
ups.com [mailto:[EMAIL PROTECTED]
<mailto:flexcoders%40yahoogroups.com> ups.com] On
> Behalf Of jer_ela
> Sent: Monday, February 04, 2008 4:01 PM
> To: [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com> ups.com
> Subject: [flexcoders] Re: Embedding String Variable in dataprovider
name
> 
> 
> 
> you can use a method to get around that
> 
> dataProvider="{getDp(chartXML2.lastResult, month)}"
> 
> private function getDp(lastResult:Object, month:String):String
> { return lastResult[month].day;
> }
> 
> The method will be called when ever one of it parameters is changed
> 
> --- In [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com>
> ups.com, "Brad Bueche" <brad@> wrote:
> >
> > That worked!
> > 
> > I still get the following warning:
> > 
> > Data binding will not be able to detect changes when using square
> > bracket operator. For Array, please use ArrraCollection.getItemAt()
> > instead.
> > 
> > But it still works. 
> > 
> > brad
> > 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com>
> ups.com [mailto:[EMAIL PROTECTED]
> <mailto:flexcoders%40yahoogroups.com> ups.com] On
> > Behalf Of jer_ela
> > Sent: Friday, February 01, 2008 3:01 PM
> > To: [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com>
ups.com
> > Subject: [flexcoders] Re: Embedding String Variable in dataprovider
> name
> > 
> > 
> > 
> > If you use the square brackets then you don't use the dot so it
should
> > be:
> > 
> > dataProvider="{chartXML2.lastResult[month].day}"
> > 
> > --- In [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com>
> > ups.com, Maciek Sakrejda <msakrejda@> wrote:
> > >
> > > I'm no e4xpert, but
> > > 
> > > dataProvider="{chartXML2.lastResult.[month].day}"
> > > 
> > > should do it.
> > > 
> > > -- 
> > > Maciek Sakrejda
> > > Truviso, Inc.
> > > http://www.truviso. <http://www.truviso. <http://www.truviso.
<http://www.truviso.com> com>
> com> com
> > > 
> > > -----Original Message-----
> > > From: brad.bueche <brad@>
> > > Reply-To: [EMAIL PROTECTED]
<mailto:flexcoders%40yahoogroups.com>
> > ups.com
> > > To: [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com>
> ups.com
> > > Subject: [flexcoders] Embedding String Variable in dataprovider
name
> > > Date: Fri, 01 Feb 2008 15:40:25 -0000
> > > 
> > > Really what I need to be able to do is insert the variable name in
> > this:
> > > 
> > > dataProvider="{chartXML2.lastResult.month.day}"
> > > 
> > > I need to replace the "month" with a string variable name (i.e
> public
> > > var monthName = "January";)
> > > 
> > > I also need to do the same for the categoryfield as it will not
let
> me
> > > do categoryfield=$String.
> > > 
> > > In PHP this is incredibly easy to do. You just say blah=$string .
In
> > > fact, in PHP you can embed variable names everywhere. Its very
> > > powerful. For instance, in php, for the dataprovider issue above,
> i'd
> > > just do
> > > 
> > > dataProvider="{chartXML2.lastResult.$StringName.day}"
> > > 
> > > and it'd work just fine. Whats the syntax for doing this in Flex?
> > >
> >
>





 

Reply via email to