Masked text

Hi.

I’m having a problem with masked text in Flash animation. I have a dynamic text field (lets say the name of that field is DTF) on the main timeline which is masked and when I send data to the text field using the client it works fine, but if I try to change that text in the external AS3 class (for example add a number at the end of the text - DTF.text += “3”; ) nothing happens. Without the mask, everything works normally, but with the mask, anything that I apply in the external class just doesn’t affect the DTF.

Any suggestions how I can work this around?

Can you upload it somewhere?

Sure. Here’s the link.

https://we.tl/t-lm0keXFHBh

You have to address the text by it’s full path
eg. teks1mc.tekst1.text += “3”

I did. Text Field seems to be inaccessible from the AS3 Class when masked.

Did you try to apply the mask from your class?
Convert both to movieclips and apply the mask

text_mc.mask = mask_mc;

Then set the number at the end

text_mc.DTF.appendText(“3”);

The problem is that the mask is a rectangle that changes its size in every frame. I’ve tried creating a movie clip on the main timeline and using it as a mask, but it didn’t work. I don’t know how to do that from the class.

You should create a rectangle and change its size with a tween.
Also it’s a good practice to set both the masked movie clip and the mask as cached bitmap

_clip.cacheAsBitmap = true;
_mask.cacheAsBitmap = true;
_clip.mask = _mask;

That‘s not true, I do that every day. I downloaded your files, but did not get a clue, what is wrong. But probably you should try with a rectangle and use a motion tween to animate it, so that it is a single object changing over time.

And by the way: It‘s a simple wipe, that can be done by moving a rectangle from outside the stage and back, I have no idea, why you want to do it as complicate as possible.

1 Like

Motion tween did the job. Thank you for your help.