Skip to main content
Known Participant
June 10, 2010
Question

Overwrite TextFlow color !?

  • June 10, 2010
  • 1 reply
  • 844 views

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 has been closed for replies.

1 reply

Known Participant
June 14, 2010

Any ideas?

Adobe Employee
June 14, 2010

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.

Known Participant
June 15, 2010

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});
}