Skip to main content
Inspiring
June 7, 2008
Question

dynamic Text field during runtime, word wrap

  • June 7, 2008
  • 5 replies
  • 604 views
Hi

I have this code fragment on a frame:

this.createTextField ("tData",this.getNextHighestDepth (),189,353,600,100);
tData.text="Alcohol is a powerful drug cause by fermentation of sugars and is the active principle of intoxicating drinks";

I have placed the text onstage during runtime, starting from 189, however, the text is longer than what I have specified. I have specified 600, 100. I do not want to increase the length. How do I wrap the text so that it fits instead of disappearing off the stage? What is the additional code I need to embed?

Thanks.

This topic has been closed for replies.

5 replies

Inspiring
June 11, 2008
Hi NedWebs,
Thank you for your reply.

My next question and instead of opening up a new thread is related to this.

True and False situation using radio buttons.

I have created a true false quiz. I have set up the questions and displayed the answers. I am now working on the true false button logic.

For example,

(Declaring the imports - not sure if this is as3 feature only or also a as2 feature)

import fl.controls.RadioButton;
import fl.controls.RadioButtionGroup;
import fl.controls.Button;

check box or check button (change of names but same functionality or am i mistaken for this

var rbGroup: RadioButtonGroup = new RadioButtonGroup;

then I identify the radio buttons.

Am I on the right track? Is the algorithm for this true false quiz actionscript standard? where can i get a script and adapt it for my purposes?

Thank you.

Reynold
Ned Murphy
Legend
June 9, 2008
You're welcome.
Inspiring
June 8, 2008
Thank you both. I tried both your replies and then I tweaked the 600 width of this message. It did not work if I didnt tweak this value. I have learned from you both that your coding will work if the declared width is less than the tData.text. Thank you for your replies and help.
kglad
Community Expert
Community Expert
June 8, 2008
and enable its multiline property.
Ned Murphy
Legend
June 7, 2008
Try this... After you create the text field set its wordWrap and autoSize...

tData.wordWrap = true;
tData.autoSize = "left";