Solved

Multi line text field

Posted on 2003-10-30
5
163 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
Comment Utility
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
Comment Utility
I use no 2 it works, but I must click the text first to see the second line
0
 

Author Comment

by:Cyber_Cus2
Comment Utility
how to fix that problem?
0
 
LVL 27

Accepted Solution

by:
negatyve earned 500 total points
Comment Utility
>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
Comment Utility
ok2 it works. i've made a mistake. thanks anyway
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
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 this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now