|  | dynamic Text field during runtime, word wrap |  | |
| | | rchung1685@aol.com |  |
| Posted: Sat Jun 07, 2008 8:54 pm Post subject: dynamic Text field during runtime, word wrap |  |
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. |
| |
| | | noir |  |
| Posted: Sat Jun 07, 2008 9:32 pm Post subject: Re: dynamic Text field during runtime, word wrap |  |
this.createTextField ("tData",this.getNextHighestDepth (), 189,353,600,100); tData.autoSize = true; tData.multiline = true; tData.wordWrap = true; tData.text="Alcohol is a powerful drug cause by fermentation of sugars and is the active principle of intoxicating drinks"; |
| |
| | | NedWebs |  |
| Posted: Sat Jun 07, 2008 9:38 pm Post subject: Re: dynamic Text field during runtime, word wrap |  |
Try this... After you create the text field set its wordWrap and autoSize...
tData.wordWrap = true; tData.autoSize = "left"; |
| |
| | | kglad |  |
| Posted: Sun Jun 08, 2008 6:37 am Post subject: Re: dynamic Text field during runtime, word wrap |  |
| and enable its multiline property. |
| |
| | | rchung1685@aol.com |  |
| Posted: Sun Jun 08, 2008 9:34 pm Post subject: Re: dynamic Text field during runtime, word wrap |  |
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. |
| |
| | | NedWebs |  |
| Posted: Mon Jun 09, 2008 2:25 am Post subject: Re: dynamic Text field during runtime, word wrap |  |
| |
| | | rchung1685@aol.com |  |
| Posted: Wed Jun 11, 2008 12:34 am Post subject: Re: dynamic Text field during runtime, word wrap |  |
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 |
| |
|
|