Mask image does not appear on the screen
- by Ponty
I have imported to the library two images and have given them the custom class names MaskImage and MaskedImage. Then i write the code:
package
{
import flash.display.*;
public class MaskDemo extends Sprite
{
// Properties
private var sprMaskedImage:Sprite;
private var sprMaskImage:Sprite;
private var bmMaskedImage:Bitmap;
private var bmMaskImage:Bitmap;
// Constructor
public function MaskDemo()
{
do_magic();
}
// Methods
private function do_magic():void
{
bmMaskedImage = new Bitmap(new MaskedImage(0, 0));
bmMaskImage = new Bitmap(new MaskImage(0, 0));
sprMaskedImage = new Sprite();
sprMaskedImage.addChild(bmMaskedImage);
sprMaskImage = new Sprite();
sprMaskImage.addChild(bmMaskImage);
sprMaskedImage.mask = sprMaskImage;
this.addChild(sprMaskImage);
}
}
}
But it does not appear anything on the display. Any ideas why is happening that?