Welcome, Guest. Please login or register.
Did you miss your activation email?
31 Jul 2010, 11:30:17 UTC
Forum home
+  flexdeveloper.eu Forum
|-+  Flex and ActionScript 3.0
| |-+  ActionScript 3.0 (Moderators: JMWhittaker, Jan K, thewarpedcoder, James)
| | |-+  Custom text component with different start and end points for each line
« previous next »
Pages: [1] Print
Author Topic: Custom text component with different start and end points for each line (Read 217 times)
slingsla
Newbie FD
*
Posts: 1


« on: 10 Mar 2010, 20:58:10 UTC »

I'm trying to create a custom component extending textArea in which each individual line in the textArea would have different start and end points.  For example, the start/end points for line 1 might be 20 pixels in the front and 35 pixels at the end but start/end points for line 2 might be 25 pixels in front and 20 pixels at the end, etc.  These boundary values would be passed in.  The width of the entire textArea component would be a fixed size.  The result would be something like this:

 

     Jack and Jill
          ran up the hill
  to fetch a pail of water

 

depending on the boundary values of each individual line of course.  The custom component would take a string and render it in the text component with the appropriate individual line start and end points.  I'm trying to do this by adding the text component to the display with the passed in string and then adding in spaces in the beginning of each line and adding a "/n" at the end of the line wherever appropriate based on the start and end values for that line.  This would then involve a custom wordwrap when placing the "/n".  An issue I've encountered already is having to reupdate the display after each adjustment (adding in spaces or a /n) in order to make the subsequent adjustments.  I'm not sure what the best way to do this is.

I'm wondering if I'm on the right track and if anyone has any advice on this, especially if I'm missing an easier way of going about this.  Thank you
Logged
Pages: [1] Print
« previous next »
Share this on: Twitter Twitter Del.icio.us del.icio.us Digg Digg
Jump to:

©2006-2010 Flexdeveloper.eu/Jodie O'Rourke. All rights reserved.
Adobe®, Adobe® Flash™, Adobe® AIR™ and Adobe® Flex™ are registered trademarks of Adobe Systems Incorporated in the United States and other countries. All rights reserved.

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC