开发者

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

I have spark States declare开发者_开发知识库d 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜