Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Site Design > Flash Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Flash Discussion Forum Flash design presents a limitless number of possibilities for your sites and designs. Discuss your Flash ideas, questions and issues here.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-14-2003, 12:09 PM
WebProWorld Member
 

Join Date: Aug 2003
Location: UK
Posts: 77
poab RepRank 0
Default wordWrap failing strangely

Hi,

I seem to have a small problem with wordWrap in my text field I've never come across it before (which I find a bit bizarre) and it's driving me nuts: When using '\r' or '\n' or setting the field to html and using '
' the wrapping sometimes fails.

Here's an example.

For the purposes of demonstration the script I've used is:

(I've put in a few extra returns to stop the thread increasing the width of this page).
Code:
myFormat = new TextFormat();
myFormat.font = "embeddedfont";
myFormat.size = 8;
_root.createTextField("myField", 0, 10,10, 250, 200);
_root.myField.embedFonts = true;
_root.myField.wordWrap = true;
_root.myField.text = "Lorem ipsum dolor sit amet, consectetuer adipiscing
 elit.\r\rInteger condimentum mattis pede. Sed\rmauris quam, consequat sit 
amet,\r\rpharetra ac, tempus in, quam. Nam scelerisque condimentum arcu. 
Etiam eu quam. Integer sed tellus. Nulla pulvinar. Vestibulum metus. 
Pellentesque sodales quam non libero. Mauris convallis metus ut arcu. In nec 
magna nec dui congue pulvinar. Proin laoreet sollicitudin nulla. Aliquam erat
 volutpat. Sed interdum. Integer feugiat consequat sem. Integer dui mauris, 
iaculis at, adipiscing ut, nonummy et, pede. Ut id erat eget diam tincidunt 
malesuada. Aenean rutrum enim in nibh. Aliquam consequat cursus lectus. 
Aliquam mollis pulvinar erat. Phasellus sollicitudin congue mi. Nunc lacinia wisi
 id ligula. Ut vestibulum, libero eu egestas eleifend, massa libero pretium erat,
 vel luctus velit nulla non arcu. Curabitur ut wisi eget velit consequat tincidunt.
 Maecenas dolor quam, malesuada et, sollicitudin et, molestie ac, quam. 
Suspendisse ultrices, purus quis auctor suscipit, odio ante euismod tellus, in 
pellentesque dui dui sed lorem. Ut id nisl. Etiam metus ante, pulvinar sit amet,
 vulputate vitae, cursus vel, massa. Duis leo odio, auctor quis, blandit a, 
suscipit vitae, felis. Nunc id leo eu neque pulvinar volutpat. Integer
 pellentesque tellus vitae dolor. Aliquam tempor dictum neque. In venenatis, 
nibh quis pharetra laoreet, neque urna commodo velit, et molestie diam tellus
 a lorem. Phasellus ipsum lectus, tristique ac, dapibus in, convallis at, odio.
Donec ligula wisi, pellentesque a, placerat vitae, tincidunt in, est. Aenean 
mauris orci, venenatis et, adipiscing nec, cursus et, urna. Sed mauris diam, 
bibendum at, fermentum at, commodo sit amet.";
_root.myField.setTextFormat(myFormat);
_root.myField.border = true;
which works fine. If I then reduce the width of the text field as so:

Code:
//etc.
_root.createTextField("myField", 0, 10,10, 243, 200);
_root.myField.embedFonts = true;
//etc.
it then fails to wrap. If I then set embedded fonts to false:

Code:
//etc.
_root.createTextField("myField", 0, 10,10, 243, 200);
_root.myField.embedFonts = false;
//etc.
It works again. I thought there may be a problem with the font so I tried it with a couple of others. The effect is still there, but the widths at which the word wrap fails varies.

Has anyone come across this before and what do I do about it? Any thoughts gratefully recieved.

cheers.
Reply With Quote
  #2 (permalink)  
Old 02-27-2004, 10:19 AM
WebProWorld Pro
 

Join Date: Aug 2003
Location: Greentown, PA
Posts: 104
cyberious RepRank 0
Default

Did you resize the text box using the resize handles instead of resizing it with the Text tool? Sometimes that causes strange reactions.

Just a thought. At a quick read your code looks fine, and you embedded the font, so I don't think that's the problem.

Is your font in the Library? Could it have been deleted?
Reply With Quote
Reply

  WebProWorld > Site Design > Flash Discussion Forum
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0