Skip to main content
Participant
March 15, 2009
Answered

Textline respecting maks

  • March 15, 2009
  • 5 replies
  • 763 views
Hi,

I'm playing around with the TLF, and I'm noticed a small bug. Some of my textLines aren't respecting the mask I use on them. I see this when calling TextBlock::createTextLine( null, XXX, 0.0, true ), where XXX is a small value, smaller than the textLine I'm creating. After creating the textLine, I apply the mask (which has been added to a display container) and add it to the displayContainer. The textLine doesn't respect the mask. When this happens the TextBlock::TextLineCreationResult = 'emergency'.

If I make a text line that fits the width that I specify in CreateTextLine(), everything works. It's only when I make the line too long that the mask doesn't work.

Any work arounds? If not can this be logged?

Thanks
Rob
This topic has been closed for replies.
Correct answer rdermer
That's expected behavior.

From the docs of the DisplayObject.mask property:

Note: A single mask object cannot be used to mask more than one calling display object. When the mask is assigned to a second display object, it is removed as the mask of the first object, and that object's mask property becomes null.

5 replies

mrrolfAuthor
Participant
March 18, 2009
I guess I should RTFM a bit better. Thanks :)
rdermerCorrect answer
Adobe Employee
March 17, 2009
That's expected behavior.

From the docs of the DisplayObject.mask property:

Note: A single mask object cannot be used to mask more than one calling display object. When the mask is assigned to a second display object, it is removed as the mask of the first object, and that object's mask property becomes null.
mrrolfAuthor
Participant
March 17, 2009
I poked around a little bit more. If I create a new mask for each TextLine the TextBlock creates, it works.

If all lines share the same mask, it looks like the last line added is the only one to respect the mask.
mrrolfAuthor
Participant
March 17, 2009
Thank Robin

Let me know if I can provide anymore information that will help.

Rob
Adobe Employee
March 17, 2009
I have forwarded this question on to the Player team, and will let you know when I've heard back from them.

Thanks!

- robin