Highlighted

replace " " with "#"

Explorer ,
Nov 21, 2017

Copy link to clipboard

Copied

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

}

TOPICS
Development

Views

177

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

replace " " with "#"

Explorer ,
Nov 21, 2017

Copy link to clipboard

Copied

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

}

TOPICS
Development

Views

178

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 21, 2017 0
ASWC LATEST
Advocate ,
Nov 22, 2017

Copy link to clipboard

Copied

You need to use a StageText not a TextField

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 22, 2017 0