ActiveDen

Ignorewhitespace on Textfield

55 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 10 and 49 items
  • Netherlands
Rumboon says

Hi there,

Does anyone know how you can turn on the IgnoreWhitespace on a Textfield (or String variable) ?

My problem in with JSON : In String textfields he’s shows up with alot of breaks, like:

{"textValue": "Lorem ipsum dolor<br />
sit amet<br />
lorem ipsum dolor<br />}

My flash textfield looks like this now:

Lorem ipsum

dolor sit

amet
4 months ago
1301 posts
  • Has been a member for 2-3 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Author had a Free File of the Month
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 1 and 9 items
  • Croatia
  • Referred between 1 and 9 users
Tean says

Because you have break tags. As for whitespace use regexp.

4 months ago
55 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
  • Bought between 10 and 49 items
  • Netherlands
Rumboon says

What i want is that the Text output look likes this: with one break:

lorem ipsum
dolor sit
amet

Working with XML data it should be easy: XML .ignoreWhitespace = true; But how can i get that result with JSON data?

4 months ago
7 posts
  • Has been a member for 1-2 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
xcstu says
You can try TextField’s condenseWhite:
var tf:TextField = new TextField(0, 120, 200, 50);
tf.condenseWhite = true;
tf.htmlText = "keep    on\n\ttruckin'";
addChild(tf);
3 months ago
by
by
by
by
by