AS2: Dynamically space out letters

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

I needed a way to dynamically space out letters. Here's an example using style sheets in Flash.

Copy this code and paste it in your HTML
  1. _root.createTextField("test_txt", this.getNextHighestDepth(), 0, 0, 400, 100);
  2. var myCSS:TextField.StyleSheet = new TextField.StyleSheet();
  3. myCSS.setStyle(".display", {letterSpacing:'15px'});
  4. test_txt.styleSheet = myCSS;
  5. test_txt.text = '<span class="display">red_________red</span>';

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.