2012-01-26 30 views
0

Flex 3のTextInputからフォーカスイン/アウトを実装しようとしています。コントローラを使用してすべてのコンポーネントイベントを処理しています。目標に応じて適切な方法に「進む」。 My TextInputのidは "contactInput"ですが、イベントターゲットには "MainView0.topContainer.contactInput.UITextField8"のようなものがあります。このUITextField8はどこから来たのですか? 「contactInput」だけでは選択できないのですか? これは私のコードは、アプリケーション上で私は、すべてのイベントのためにとfocusIn/focusOutを定義し、次のとおりです。Flex 3 - TextInputのフォーカス/アウト

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
       xmlns:ui="ui.*" 
       xmlns:ws="ui.presenters.*" 
       xmlns:components="ui.components.*" 
       width="255" height="310" minWidth="255" minHeight="310" 
       creationComplete="controller.init(event)"      
       styleName="application" 
         applicationComplete="controller.init(event)" 
         focusIn="controller.focusIn(event)" 
       focusOut="controller.focusOut(event)" 

私のコントローラコード:

public function focusIn(event:FocusEvent):void {     
     Alert.show("focus in -> target: " + event.target); 

     switch (event.target) { 
      case view.contactInput:    
       onContactInputFocusIn(); 
       break; 
     } 
    } 

    public function focusOut(event:Event):void { 
     Alert.show("focus out -> target: " + event.target); 

     switch (event.target) { 

      case view.contactInput: 
       onContactInputFocusOut(); 
       break;   
     } 

このコードで間違った任意のものがありますか?私はちょうど混乱しています。

答えて

0

caseとonContactInputFocusOut()関数の間にAlert.show関数を配置してください。両方の関数にAlert.showを入れて、case文に入っているかどうかを確認してください。

関連する問題