2009-11-29 202 views
1

是否可以在flex中将多个状态分配为另一个状态的基础? 说我有状态“stateA”,添加一个按钮“buttonA”和状态“stateB”,添加一个按钮“buttonB”。是否有可能创建一个基于状态“stateA”和“stateB”的状态“stateC”? 如果没有,是否有解决方法来实现这一目标?flex状态基于多个状态

还要注意,按钮ID应该是“按钮a”和“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> 

回答

1

我不认为这是可能的。但我似乎有一个变通的这种特殊情况:

  • stateC既有buttonAbuttonB
  • stateA,基于stateC,消除buttonB
  • stateB,基于stateC,消除buttonA

这足够你的用例吗?

+0

在箱子外面思考...非常好! – Ofir 2009-11-29 17:14:38