Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the name property of spark State declaratively to a string variable value

I have spark States declared in mxml. I also have a class with string constants. I want my states names to match the string constants. Is it possible to do that directly in mxml and how? I don't want to use the same string, I want to set the name property to the constant's value.

code:

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

mxml:

<s:State name="new"/>
<s:State name="edit"/>

As far as I know state names need to be processed at compile time so probably it's not possible.

like image 596
Branislav Abadjimarinov Avatar asked May 20 '11 07:05

Branislav Abadjimarinov


1 Answers

Yes, the problem is you cannot include constants in state declarations :(

like image 89
Constantiner Avatar answered Oct 18 '22 23:10

Constantiner