Skip to main content
Known Participant
November 21, 2017
質問

replace " " with "#"

  • November 21, 2017
  • 返信数 1.
  • 288 ビュー

i can use the following code in the test environment to swap space for hashtags as i type - but it doesn't work on the iPhone. I'm guessing that the text fields can listen for changes?

Is there a way around it? a workaround?

myText.addEventListener(Event.CHANGE, checker);

var str:String

var search:String

var replace:String

function checker(e:Event):void{

  str=this.myText.text

  search=" "

  replace="#"

  strReplace()

}

function strReplace(evt:Event=null):void {

str=str.split(search).join(replace);

  this.myText.text=str

}

このトピックへの返信は締め切られました。

返信数 1

Inspiring
November 22, 2017

You need to use a StageText not a TextField