dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Help Replacing Wrap with Line break

  1. #1
    Senior Member
    Join Date
    Apr 2004
    Posts
    111

    Help Replacing Wrap with Line break

    Hi All,

    This may be simple, but i need some help.

    I have a dynamic textfield - mytext.textfield - which i dynamically set the width of. The textfield is multiple lines and the line will wrap at different places depending on the textfield width.

    I save the contents of the textfield to a mysql database and then use it in a pdf, the problem is i need to know where the line wraps prior to sending it to mysql.

    Is there any way to detect the wrap point and replace it with a Line Break code that can then be used in my pdf building ???

    I would appreciate any help possible.

    Cheers

    Lawro
    Trying deperately to understand
    actionscript

  2. #2
    Senior Member
    Join Date
    Sep 2000
    Location
    Pittsburgh
    Posts
    252
    Hi,

    There is nothing natively that will allow you to do this in flash. But you can kind of pre-process (proper term?) your string within a dummy textfield offstage which has the same width / font / fontsize and figure out when it goes beyond the required width. I put together a file, rather quickly, and tried to comment best I could, i'm not very verbose. There may be better, easier and or cleaner ways to do this but it's a starting point for ya if nothing else. I tested it on a few strings but i can't be certain it will work in every possible scenario.

    hope this helps some,
    Dunc
    Attached Files Attached Files

  3. #3
    Senior Member
    Join Date
    Apr 2004
    Posts
    111
    Thanks for taking the time to put a file together for me ... i'll give it a try.

    Cheers
    Trying deperately to understand
    actionscript

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center