2010-02-04 23 views
1

an example on Adobe livedocs for using statesFlex 3中mx:target的作用是什麼?

<!-- Define one view state, in addition to the base state.--> 
    <mx:states> 
     <mx:State name="Register"> 
      <mx:AddChild relativeTo="{loginForm}" position="lastChild"> 
       <mx:target> 
        <mx:FormItem id="confirm" label="Confirm:"> 
         <mx:TextInput/> 
        </mx:FormItem> 
       </mx:target> 
      </mx:AddChild> 
      <mx:SetProperty target="{loginPanel}" name="title" value="Register"/> 
      <mx:SetProperty target="{loginButton}" name="label" value="Register"/> 
      <mx:SetStyle target="{loginButton}" 
       name="color" value="blue"/> 
      <mx:RemoveChild target="{registerLink}"/> 
      <mx:AddChild relativeTo="{spacer1}" position="before"> 
       <mx:target> 
        <mx:LinkButton id="loginLink" label="Return to Login" click="currentState=''"/> 
       </mx:target> 
      </mx:AddChild> 
     </mx:State> 
    </mx:states> 

我一直沒能找到MX的目的:目標

<mx:AddChild relativeTo="{spacer1}" position="before"> 
       <mx:target> 
        <mx:LinkButton id="loginLink" label="Return to Login" click="currentState=''"/> 
       </mx:target> 
      </mx:AddChild> 

有誰知道做什麼,如果有必要嗎?這似乎是沒有必要的。

+0

好問題。我希望你能得到這個答案,但我不會屏住呼吸等待一個。 – Robusto 2010-03-10 21:29:59

回答

0

看起來我過度認爲這一點。發現目標僅僅是您要添加的目標孩子,這只是將其定義爲另一種方式,而不是將其定義爲AddChild標記的內聯屬性。

相關問題