Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

dynamic Text field during runtime, word wrap

Participant ,
Jun 07, 2008 Jun 07, 2008
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.

TOPICS
ActionScript
611
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 07, 2008 Jun 07, 2008
Try this... After you create the text field set its wordWrap and autoSize...

tData.wordWrap = true;
tData.autoSize = "left";
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 07, 2008 Jun 07, 2008
and enable its multiline property.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 08, 2008 Jun 08, 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 08, 2008 Jun 08, 2008
You're welcome.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 10, 2008 Jun 10, 2008
LATEST
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines