Skip to main content
Known Participant
November 24, 2009
Answered

TLF with bevelFilter

  • November 24, 2009
  • 1 reply
  • 1276 views

is there some way to set different values of bevelFilter to diferents parts of the text?

This topic has been closed for replies.
Correct answer robin_briggs

Thanks, but i need to get the reference to some object that ineriths from DisplayObject to set the filters array with i.e [new BevelFilter()], if there is some way to get the reference to any range of characters it would be perfect for my app, but if i get only The text in String objects it doesnt works for my app.


Given a TextFlowLine, you can get the corresponding TextLine by calling getTextLine(true). A TextLine is a DisplayObjectContainer.

- robin

1 reply

Adobe Employee
November 24, 2009

Since each line (TextLine) is a DisplayObject, you should be able to set filters on a line within a container, but you can't set a filter on a part of a line.

Hope this helps,

- robin

javii1986Author
Known Participant
November 24, 2009

Thanks for answer Robin.

But i cant see where i can get the Text Line for example in this code (from the TLF docomentation). I have find in almost all classes of the framework but i cant find how to do it.

var textFlow:TextFlow = TextFilter.importToFlow(markup, TextFilter.TEXT_LAYOUT_FORMAT);

// second, create a controller
// the first parameter, this, must point to a DisplayObjectContainer
// the last two parameters set the initial size of the container in pixels.
var contr:IContainerController = new DisplayObjectContainerController(container, 600, 600);

// third, associate it with the flowComposer property
textFlow.flowComposer.addController(contr);

// fourth, update the display list
textFlow.flowComposer.updateAllContainers();

javii1986Author
Known Participant
November 24, 2009

I tried to get the line with this code but it traces null:

var markup:XML = <TextFlow><p><span>Hello, world</span></p></TextFlow>;
var textFlow:TextFlow = TextFilter.importToFlow(markup, TextFilter.TEXT_LAYOUT_FORMAT);
var textFlowLine:TextFlowLine = textFlow.flowComposer.findLineAtPosition(0);
trace(textFlowLine.textLine);