• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 34. Using Masks > Another Example

Another Example

Let's try this with shapes we create ourselves. See Figure 34.3.

this.createEmptyMovieClip("maskMe_mc",1);

with (maskMe_mc)
{
    lineStyle(5,0x0000FF);
    moveTo(100,100);
    beginFill(0x0000FF);
    lineTo(100,300);
    lineTo(300,300);
    lineTo(300,100);
    lineTo(100,100);
    endFill();
}

this.createEmptyMovieClip("mask_mc",2);

with (mask_mc)
{
    lineStyle(5,0x000000);
    moveTo(100,100);
    beginFill(0x000000);
    lineTo(100,200);
    lineTo(200,200);
    lineTo(200,100);
    lineTo(100,100);
    endFill();
}
maskMe_mc.setMask(mask_mc);


mask_mc.onPress = function()
{
    this.startDrag();
}
mask_mc.onRelease = function ()
{
    this.stopDrag();
}


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint