Short way of adding ... to long text


/ Published in: ActionScript 3
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.