2

I create a new object. My new object will always have a labelField because it has to be added to a dataProvider in a ComboBox. The problem is my next property. Each object in the dataProvider has a dataField property that has a string value [eg: 'code' or 'isoCode']. What I want to be able to do is this:

var myObject:Object = new Object;                 // functional
var myOtherObject:Object = new Object;            // functional

myOtherObject[dataField] = "code";                // functional

myObject[labelField] = "Hi";                      // functional
myObject[myOtherObject[dataField].value] = "ALL"; // not functional

Any help would be appreciated.

1 Answer 1

4

Try this:

var myObject:Object = new Object();
var myOtherObject:Object = new Object();

myOtherObject.dataField = "code";

myObject.labelField = "Hi";
myObject[myOtherObject.dataField] = "ALL";
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.