开发者

flex state basedOn multiple states

开发者 https://www.devze.com 2022-12-12 23:28 出处:网络
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 poss

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

精彩评论

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