Select to view content in your preferred language

resultGraphic attribute Assignment

826
2
Jump to solution
01-24-2012 05:01 PM
ShaunWeston
Frequent Contributor
I'm trying to setup a configuration xml file for a user to set the field names in, which would then be picked up by the mxml script.

Basically I have a bunch of code like this:

var Ratepayer1LastName:String = resultGraphic.attributes.Ratepayer1LastName;
var Ratepayer2FirstName:String = resultGraphic.attributes.Ratepayer2FirstName;

And I want that last bit to be set by the user in an xml file. So I basically want this bit to always stay the same - "resultGraphic.attributes." and then the last bit (e.g. Ratepayer1LastName) to be assigned from an xml file.

I'm not sure how to do this? If I go:

userconfig = configXML.windowtitle
var Ratepayer1LastName:String = "resultGraphic.attributes." + userconfig;
it obviously just takes that string and not the actual attribute value.

I've got myself a bit confused.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Shaun,

   You should be able to do this:


userconfig = configXML.windowtitle var Ratepayer1LastName:String = resultGraphic.attributes[userconfig];


Don't forget to click the top arrow (promote) and to click the Mark as answer check as shown below:

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus
Shaun,

   You should be able to do this:


userconfig = configXML.windowtitle var Ratepayer1LastName:String = resultGraphic.attributes[userconfig];


Don't forget to click the top arrow (promote) and to click the Mark as answer check as shown below:
0 Kudos
ShaunWeston
Frequent Contributor
Awesome thanks that's what I'm after. You have saved me a lot of time trying to figure that out when it was quite easy.
0 Kudos