Wordwrap
by kleio78 » Thu, 17 Aug 2006 05:56:51 GMT
I'm trying to create a multiline textbox in actionscript. See code
below. The text I'd like to wrap is "this.description" a string read in
from an XML node that contains linebreaks. However, Flash truncates
text after the linebreaks, and will also not wrap long lines of text.
But when I do a trace() on the text at the end, it's returning the
entire string correctly. Any suggestions? Thanks in advance.
_____________
this.textBox2=this.createTextField("tb2", this.getNextHighestDepth(),
this.screenWidth/2, this.shell._y+this.captionOffset+boxFormat1.size*2,
this.screenWidth/2, this.captionSize);
var boxFormat2:TextFormat = new TextFormat();
boxFormat2.color = 0xCCCCCC;
boxFormat2.align="left";
boxFormat2.font="embeddedArial";
boxFormat2.size=this.captionSize-12;
this.textBox2.embedFonts=true;
this.textBox2.multiline = true;
this.textBox2.wordWrap = true;
var tempText:String = clean(this.description);
this.textBox2.text=tempText;
this.textBox2.setTextFormat(boxFormat2);
trace(this.textBox2.text);
Similar Threads:
1.Safari dynamic text wordwrap problems
I'm having issues with dynamic text fields in safari. The text does not seem
to be wrapping correctly. Most of the text wraps but on some lines there are a
few words off to the right of the text box that can't be seen. Yes, the text
box is set to wordwrap. Has anybody ever heard of this happening before. I
don't think it's a known issue because i can't find any info searching google.
This only happens on the safari browser, every other browser displays the text
flawlessly.
Please help.
2.textField.autoSize/wordWrap question
Hey,
Quick question. I'm trying to right justify various sentences, 1-3 lines of
text each in a separate text box, and then
position the text boxes, dynamically. Here's what I have, but the syntax of
the actionscript is messing me up.
myText.autoSize = 'right';
myText.wordWrap = true;
this._y = [previous item]._y + [previous item]._height;
myText = [text goes here];
For one line of text, it works fine. For more than one line of text, it only
shows the first line, and then adds another half line to the text box, but
doesn't display more text. Any ideas?
Thanks,
Jeremy
3.Wordwrap does not work
Hi !
I have a dynamice text field which uses a variable which is set externally.
The problem is that the words do not wrap round the text box, so that only
"There has been a dispensing error and he is tak" appears whereas
"There has been a dispensing error and he is taking the wrong dose" should
appear.
Any help would be much appreciated
Chris
4.Problem WordWrap in dynamically scrolling text
5.Setting the wordWrap on the Checkbox component
Anyone know how to get a flash quiz template checkbox to set to multi line? I
have tried:
onClipEvent (load) {
this.checkbox.labelPath.multiline = true;
this.checkbox.labelPath.wordWrap = true;
}
and also on the keyframe that contains the checkbox text fields:
checkbox1.labelPath.multiline = true;
checkbox1.labelPath.wordWrap = true;
Any ideas?
6. Wordwrap in List component
7. Problem with getTextExtent and wordWrap
8. Gretting true text width from wordWrapped textField?