开发者

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

开发者 https://www.devze.com 2023-03-07 17:33 出处:网络
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 h

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

精彩评论

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