When you use bracket notation, it replaces the left "dot.  Try:

chartXML2.lastResult[month].day

 

However, this is going to be hard to debug.  I'd advise binding to an
instance variable, and assigning the xmllist to that var in a result
handler.

 

Tracy

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Brad Bueche
Sent: Friday, February 01, 2008 1:32 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Embedding String Variable in dataprovider name

 

Maciek,

 

Thanks for the quick reply.

 

That generates the following errors:

 

Syntax error: expecting rightparen before rightbrace. [Generated code
(use -keep to save):

1084: Syntax error: expecting identifier before leftbracket

1084: Syntax error: expecting rightparen before destination

 

I put a right paren before it just to see what would happen.  It got rid
of the errors! but it still didnt work :(

 

I was able to get categoryfield and title to accept the  ="{StringName}"
syntax though.   I even tried to replace the entire  dataprovider entry
with a stringname, like so:

 

dataprovider="{stringName]"

 

but that did not work either. 

 

There is a larger problem that led me down this path.  But I'll open
that in another thread as it would still be really cool to figure if I
could do what we are talking about in this thread.

 

brad

        -----Original Message-----
        From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Maciek Sakrejda
        Sent: Friday, February 01, 2008 12:34 PM
        To: flexcoders@yahoogroups.com
        Subject: Re: [flexcoders] Embedding String Variable in
dataprovider name

        I'm no e4xpert, but
        
        dataProvider="{chartXML2.lastResult.[month].day}"
        
        should do it.
        
        -- 
        Maciek Sakrejda
        Truviso, Inc.
        http://www.truviso.com <http://www.truviso.com> 
        
        -----Original Message-----
        From: brad.bueche <[EMAIL PROTECTED] <mailto:brad%40bueche.com> >
        Reply-To: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
        To: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.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