/ Published in: ActionScript 3
A short way of trimming text and ... to it in AS3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var desc:String; var description:TextField = new TextField(); description.text = (desc.length > 25) ? (desc.substring(0,25) + "..." : desc addChild(description)