2010-03-22 6 views

답변

1

이 방법에 대해 :.

<?xml version="1.0" encoding="utf-8"?> 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" applicationComplete="onComplete();"> 
    <mx:Script><![CDATA[ 
     import flash.events.TextEvent; 
     private function onComplete():void 
     { 
      textInput.addEventListener(TextEvent.TEXT_INPUT, onTextInput); 
     } 
     private function onTextInput(e:TextEvent):void 
     { 
      var lastChar:String = e.text.charAt(e.text.length - 1); 
      if (lastChar == ")") 
       typed.text = "Right parentheses!!!"; 
      else 
       typed.text = lastChar; 
     } 
    ]]></mx:Script> 
    <mx:TextInput id="textInput"></mx:TextInput> 
    <mx:Label id="typed"></mx:Label> 
</mx:Application> 
관련 문제