Flex – How to set the Name property of the Spark status as a string variable value in a statement

I have a spark state declared in mxml. I also have a class of string constants. I want my state name to match the string constant. Is it possible to do this directly in mxml and How to do this?
I don’t want to use the same string, I want to set the name attribute to a constant value.

Code:

public static const create:String ='create';
public static const edit:String ='edit';

MXML:


As far as I know, the state name needs to be processed at compile time, so it may not be possible.

Yes, the problem is that you cannot include constants in the status statement: (

I have spark state declared in mxml. I also have a class of string constants. I want my state name to match string constants. Is it possible to do this directly in mxml and how to do it?
I don’t want to use the same string, I want to set the name attribute to a constant value.

Code:

public static const create :String ='create';
public static const edit:String ='edit';

MXML:


As far as I know, state names need to be processed at compile time, so it may not be possible.

Yes, the problem is that you cannot include constants in the status statement: (

Leave a Comment

Your email address will not be published.