# Newbie: Text mask from library

**URL:** <https://forum.kirupa.com/t/newbie-text-mask-from-library/273242>\
**Category:** flash\
**Created:** [October 13, 2008, 3:34pm UTC](https://forum.kirupa.com/t/newbie-text-mask-from-library/273242 "2008-10-13T15:34:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mulberry](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@mulberry](https://forum.kirupa.com/u/mulberry)\
**Post date:** [October 13, 2008, 3:34pm UTC](https://forum.kirupa.com/t/newbie-text-mask-from-library/273242/1 "2008-10-13T15:34:21Z")

</div>

Hello All,

I’d be mighty appreciative if anyone can help an AS3 newbie mask some shapes. What I want to do is create a loading screen where the text of the Web site “fills up” with a different color. The shapes are being placed in the sprite just fine, but masking the sprite doesn’t seem to be working.

Masky is a text field with text in it converted into a symbol.

Many thanks for any assistance.  
MB

```auto

stop();

import flash.display.Sprite;
import flash.display.MovieClip;

function loader() {
	// SPRITE TO HOLD SHAPES
	var sp_fill:Sprite = new Sprite();
	addChild(sp_fill);

	// ORIGINAL COLOR
	var lt_rect:Shape = new Shape();
	lt_rect.graphics.beginFill(0xDBE0E9);
	lt_rect.graphics.drawRect(0, 0, 100, 100);
	lt_rect.width = 400;
	lt_rect.height=200;
	lt_rect.x = 267;
	lt_rect.y=242;
	sp_fill.addChild(lt_rect);

	// FILL COLOR SHAPE
	var dk_rect:Shape = new Shape();
	dk_rect.graphics.beginFill(0xA7A8AC);
	dk_rect.graphics.drawRect(0, 0, 100, 100);
	dk_rect.width = 100;
	dk_rect.height=200;
	dk_rect.x = 267;
	dk_rect.y=242;
	sp_fill.addChild(dk_rect);

	// ADD MASK
	var myMask:Masky = new Masky();
	myMask.x = 267;
	myMask.y = 242;
	addChild(myMask);
	
	sp_fill.mask = myMask;

	trace(this.numChildren);

}
loader();

```
