Advertisement

06.03.2008 at 03:07AM PDT, ID: 23452589
[x]
Attachment Details

TextField Height and aligning in Rows in AS3

Asked by rgarimella in Macromedia Flash

Hi Folks,

I wanted to create 4 dynamic text fields. I dont know how much text will be in these text fields. I need to position the textfields 1 below another left aligned. How do I move the y position based on the height of the text.

Thx

RGStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
_totalDistractors = 4;
            answerChoices:Array = new Array("Lots of text", "OptionB", "OptionC", "OptionD");
               for(var i:int = 0; i < _totalDistractors ; i++) {
		
		//*******
		var taradioButtoni:TextArea = new TextArea();
		taradioButtoni.text = answerChoices[i];
		taradioButtoni.width = 370;
 
		taradioButtoni.height = taradioButtoni.textHeight + 10;
 
		taradioButtoni.move(-190, 55);
		
		taradioButtoni.y = -85 + i*(30 + taradioButtoni.height);
 
		//taradioButtoni.y = -85 +  ( i * spacing);
 
		taradioButtoni.wordWrap= true ;
		addChild(taradioButtoni);
	}
 
 
[+][-]06.03.2008 at 03:47AM PDT, ID: 21698972

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 12:57PM PDT, ID: 21723333

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.06.2008 at 03:58AM PDT, ID: 21727797

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Macromedia Flash
Sign Up Now!
Solution Provided By: SamuelRostol
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628