开发者

flex state basedOn multiple states

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 w开发者_如何学Pythonhat 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>


I don't think that is possible. But I seem to have a work around for this particular case:

  • stateC has both buttonA and buttonB
  • stateA, based on stateC, removes buttonB
  • stateB, based on stateC, removes buttonA

Would that suffice your use-case?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜