Skip to main content
Known Participant
Aug 2, 2011 1:00 PM UTC
Question

DivElement backgroundcolor doesn't work

Hi guys,

Can anyone tell me why the backgroundcolor propery of DivElement doesn't work?

import flashx.textLayout.container.ContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.elements.DivElement;

var textFlow:TextFlow = new TextFlow();

var paragraph:ParagraphElement = new ParagraphElement();
paragraph.fontSize = 16;

var se:SpanElement  = new SpanElement();
se.text                        = "asdf sdf sdf sdf sdfa sdfasdfafds afsdf adsf";

paragraph.addChild(se);

var div:DivElement = new DivElement();
div.addChild(paragraph);
div.backgroundColor = 0xff0000;

textFlow.addChild(div);

var firstController:ContainerController = new ContainerController(this,400,400);
textFlow.flowComposer.addController(firstController);
textFlow.flowComposer.updateAllControllers();

Thanks in advance!

Cheers,

Zsolt

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Adobe Employee
Aug 3, 2011 3:21 AM UTC

TLF does not support backgroundColor of "block element" right now, such as paragraph, div, textflow, because there is no border in TLF. So, we only draw backgroundColor for flash.text.engine.TextLine.  That's to say, TLF only supports backgroundColor of SpanElement.

We are implementing border feature and backgroundColor of "block element" now. Thanks!

Translate
VejkoAuthor
Known Participant
Aug 3, 2011 11:35 AM UTC

Thanks Jin-Huang, I am looking forward to the update!

Translate