Solved

Multi line text field

Posted on 2003-10-30
5
190 Views
Last Modified: 2010-04-03
I’m trying to display the details of the product from database. I put the details in textfiled dynamically. I used createTxtField and I specify the width and height. When I put the text, I want the text in multi line. I use textField.multiline = true but it doesn't want to be a multi line. The text keeps wrap to the left. I put textField.wordWrap = false as well, but it doesn't work.

_root.createEmptyMovieClip("prod_mc"+i, depth4);
var prodmc = eval("prod_mc"+i);
_root.prodmc.createTextField("desc_txt", 5, desc_xposition, desc_yposition, 100, 50);
_root.prodmc.desc_txt.border = true;
_root.prodmc.desc_txt.type = "dynamic";
_root.prodmc.desc_txt.text = details_array[i];
_root.prodmc.desc_txt.wordWrap = false;
_root.prodmc.desc_txt.multiline = true;
0
Comment
Question by:Cyber_Cus2
  • 3
  • 2
5 Comments
 
LVL 27

Expert Comment

by:negatyve
ID: 9656106
1. wordWrap should be set to true:

_root.createEmptyMovieClip("prod_mc"+i, depth4);
var prodmc = eval("prod_mc"+i);
_root.prodmc.createTextField("desc_txt", 5, desc_xposition, desc_yposition, 100, 50);
_root.prodmc.desc_txt.border = true;
_root.prodmc.desc_txt.type = "dynamic";
_root.prodmc.desc_txt.text = details_array[i];
_root.prodmc.desc_txt.wordWrap = true; // true
_root.prodmc.desc_txt.multiline = true;

2. if you want your textfield to resize according to text length:

_root.createEmptyMovieClip("prod_mc"+i, depth4);
var prodmc = eval("prod_mc"+i);
_root.prodmc.createTextField("desc_txt", 5, desc_xposition, desc_yposition, 100, 50);
_root.prodmc.desc_txt.border = true;
_root.prodmc.desc_txt.type = "dynamic";
_root.prodmc.desc_txt.text = details_array[i];
_root.prodmc.desc_txt.wordWrap = true;
_root.prodmc.desc_txt.multiline = true;
_root.prodmc.desc_txt.autoSize = true;
0
 

Author Comment

by:Cyber_Cus2
ID: 9656516
I use no 2 it works, but I must click the text first to see the second line
0
 

Author Comment

by:Cyber_Cus2
ID: 9656563
how to fix that problem?
0
 
LVL 27

Accepted Solution

by:
negatyve earned 500 total points
ID: 9656608
>but I must click the text first to see the second line

i do not. something more about your fla situation?
0
 

Author Comment

by:Cyber_Cus2
ID: 9656841
ok2 it works. i've made a mistake. thanks anyway
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question