Skip navigation
Currently Being Moderated

problem with text event

Jul 17, 2012 5:36 AM

I am using the function like this

 

txt.addEventListener(TextEvent.TEXT_INPUT, setText);

 

function setText (e:TextEvent):void {

    e.currentTarget.text=e.currentTarget.text.toUpperCase();

 

}

when i enter first text that text not changing to uppercase from second letter it is changing to uppercase.

can anyone tell me what is the problem with this function

 
Replies
  • Currently Being Moderated
    Jul 17, 2012 5:45 AM   in reply to lalitha subramanian

    have you try this? :

    txt.addEventListener(Event.CHANGE, setText);

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 17, 2012 11:59 PM   in reply to lalitha subramanian

    does this work?

     

    txt.addEventListener(Event.CHANGE, setText)

     

     

    function setText(e:Event):void {

     

              var str:String = txt.text.toUpperCase()

     

              txt.text = str

     

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points