Flex Autoscrolling textComponent

Hello All,

I am working on autoscrolling of text . when the application is loaded the component gets the data from xml file using http service.
i need to make the text which is displayed in the autoscrolling component as multiline.
Right now i did not given any width for the autoscroll component. when i mention width property i am unable to see the complete text.i need to make this text to multiline or wordwrap when i fix the width property .

how to achive this .
Who is Participating?
mah8473Connect With a Mentor Commented:
yeah as I suspected you are using the mx.control.Text class, which extends Label class. Labels do not support multi-line text.

have a look at the code in my last comment, I'm sure the UITextField class will help you achieve what you want.

Give it a go and let me know if you need further assistance
You attached ScrollingData twice, rather than the 2nd attachement being your scrollingText component.

On the assumption that your scrollingText component extends Text, you should know that Text class extends the Label class which supports single line text only.

Ii suggest you look at using the mx.core.UIFieldText class that supports mulit-line text and scrolling

I had a similiar issue where I was trying to add mulitline text to Checkbox labels, obviously the label only supports sinlge line text...attached is the custom class I wrote to get around the issue....it might help

Alternatively update the code samples you attached so I can have a look at the ScrollingText component.
package com.common.controls
	import mx.controls.CheckBox;
	import mx.core.UITextField;
	import flash.text.TextFieldAutoSize;

	import flash.display.DisplayObject;
	public class ANZMultilineCheckbox extends CheckBox
		public function ANZMultilineCheckbox()

		override protected function createChildren():void{
			// Create a UITextField to display the label.
			if (!textField)	{
				textField = new UITextField();
				textField.styleName = this;
			textField.multiline = true;
			textField.wordWrap = true;
			textField.autoSize = TextFieldAutoSize.LEFT;
		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
			super.updateDisplayList(unscaledWidth, unscaledHeight);
			textField.width = 795;
		override public function get measuredWidth():Number {
	        return textField.width + 10;

Open in new window

srujanmiryalaAuthor Commented:
Attached Scrolling text Component
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

srujanmiryalaAuthor Commented:
I will do that and let you know the result
srujanmiryalaAuthor Commented:
Hey man8473,

Thanks for the help.
Now i am using UITextField in  place of Text. it is working fine.
awesome, glad I could help....
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.