Posted By

brewsie on 04/01/10


TextField position as3 getlinemetrics

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


find X and Y positions of the last word of a line in a dynamic text field

 / Published in: ActionScript 3

  1. //mc is the mc
  2. //textfield is the textfield in question
  3. //mcX/Y is the position to place the mc after the text
  4. //getLineMetrics also returns ascent, descent, width, height, x, and leading
  6. var mcX:int=(textfield.x+textfield.getLineMetrics(textfield.numLines-1).width)+(mc.width+20);
  7. var mcY:int=(textfield.y+textfield.textHeight)+(mc.height+10);

Report this snippet  

You need to login to post a comment.