2 Replies Latest reply on Aug 14, 2008 2:40 PM by SoStew

    Creating Mask In Flash CS3

    SoStew
      HELP!!!!
      I am about to pull my hair out.

      I am new to flash and would like to know how to create a mask. Could someone please send me the step by step instructions on what to do.

      Your help is greatly appreciated.
        • 1. Re: Creating Mask In Flash CS3
          pgbaldwin
          On the stage, you do it the same as in previous version of Flash. Right click the layer your mask is on and select the 'mask' option. It will mask any layers grouped under it.

          In ActionScript you would do it like this:

          ** You need to have imported the Button class into your library, drag a Button component to the stage and then delete it. Try the code below in an empty flash file to see how it works.

          import fl.controls.Button;
          var masked:Shape = new Shape();
          var g = masked.graphics;
          g.beginFill(0xff0000,1);
          g.drawRect(0,0,300,300);
          g.endFill();
          addChild(masked);
          var masker:Shape = new Shape();
          g = masker.graphics;
          g.beginFill(0x000000,1);
          g.drawRect(150,150,50,50);
          g.endFill();
          addChild(masker);
          function applyMask(e:MouseEvent = null):void {
          masked.mask = masker;
          }
          var myButton:Button = new Button();
          myButton.label = "Apply Mask";
          myButton.emphasized = true;
          myButton.width = 150;
          myButton.move(20, 20);
          addChild(myButton);
          myButton.addEventListener(MouseEvent.CLICK, applyMask);
          myButton.y = 325;
          • 2. Re: Creating Mask In Flash CS3
            SoStew Level 1
            THANK YOU SO MUCH! i WILL TRY IT:-)