Posted By

meetneps on 11/14/08


Tagged

String Processing as3 Trimming


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

THEPWN3R
toxin20
Blacksnipe
tspitzr


Short way of adding ... to long text


 / Published in: ActionScript 3
 

A short way of trimming text and ... to it in AS3

  1. var desc:String;
  2. var description:TextField = new TextField();
  3. description.text = (desc.length > 25) ? (desc.substring(0,25) + "..." : desc
  4. addChild(description)

Report this snippet  

You need to login to post a comment.