Skip to main content
Known Participant
Jun 10, 2010 4:18 PM UTC
Question

Overwrite TextFlow color !?

Hi guys:

1. One EventListener, like: addEventListener(MouseEvent.CLICK, onMouseOver);

2. import a markup to your TextFlow and set a default color: var markup:XML = <TextFlow><p fontSize="30">Make it red!</p></TextFlow>;

3. change the color onClick:

// Does work, if I don`t set a default color in my markup. But I want to have default color and want to change the color on click

// HOW CAN I OVERWRITE THE COLOR PROPERTY?

            textFlow.color = 0xff0000;
            textFlow.flowComposer.updateAllControllers();

Thanks!

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

3 replies

Known Participant
Jun 14, 2010 8:33 AM UTC

Any ideas?

Translate
Adobe Employee
Jun 14, 2010 6:03 PM UTC

If the text is in a LinkElement, you can do an addEventListener for a FlowElementMouseEvent, this will tell you when the element is clicked on, and the handler could then set the color. If you don't want the default link appearance, you can override the linkNormalFormat with you own. That's probably the easiest way to get what you're asking for.

Translate
Known Participant
Jun 15, 2010 6:48 PM UTC

Thanks Robin,

my final solution is simple and smooth ... just tint the pixels.

containerController = new ContainerController(this, width, height);

public function set color(value:Number):void {
     TweenMax.to(this, 0.2, {tint:value});
}

Translate