基于多个状态的弹性状态
在flex中是否可以将多个状态分配为另一个状态的基础? 假设我有添加按钮“buttonA”的状态“stateA”和添加按钮“buttonB”的状态“stateB”。是否可以创建基于状态“stateA”和“stateB”的状态“stateC”? 如果没有,是否有解决方法可以实现这一点?
另请注意,按钮 ID 应该是“buttonA”和“buttonB”,并且我不能有多个处于不同状态且具有相同 ID 的按钮...
这是我想要的示例:
<mx:State name="stateA">
<mx:AddChild>
<mx:Button id="buttonA" />
</mx:AddChild>
</mx:State>
<mx:State name="stateB">
<mx:AddChild>
<mx:Button id="buttonB" />
</mx:AddChild>
</mx:State>
<mx:State name="stateC" basedOn="stateA,stateB">
</mx:State>
Is it possible, in flex, to assign multiple states as base for another state?
Say I have state "stateA" that adds a button "buttonA" and state "stateB" that adds a button "buttonB". Is it possible to create a state "stateC" that is based on state "stateA" and "stateB"?
If not, is there a workaround to accomplish that?
Also notice that the button IDs should be "buttonA" and "buttonB" and I can't have several buttons in different states with the same ID ...
Here is an example of what I want:
<mx:State name="stateA">
<mx:AddChild>
<mx:Button id="buttonA" />
</mx:AddChild>
</mx:State>
<mx:State name="stateB">
<mx:AddChild>
<mx:Button id="buttonB" />
</mx:AddChild>
</mx:State>
<mx:State name="stateC" basedOn="stateA,stateB">
</mx:State>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这是不可能的。但我似乎有一个针对这种特殊情况的解决方法:
stateC
具有buttonA
和buttonB
stateA
,基于在stateC
上,删除buttonB
stateB
,基于stateC
,删除buttonA
那满足您的用例吗?
I don't think that is possible. But I seem to have a work around for this particular case:
stateC
has bothbuttonA
andbuttonB
stateA
, based onstateC
, removesbuttonB
stateB
, based onstateC
, removesbuttonA
Would that suffice your use-case?