4 Replies Latest reply on Jul 4, 2013 5:59 AM by Mohit M Chavda

    [FB4] How to Inverse a Mask using spark??

    Bob Saggot Level 1

      This is a mask setup I have, but how would I make it so it displays everything BUT what the mask is (inverse effect)

       

           <s:Graphic>
                <s:Rect width="400" height="200" maskType="clip" >
                     <s:fill>
                          <s:SolidColor color="#FF00FF"/>
                     </s:fill>
                     <s:mask>
                          <s:Group>
                               <s:Rect width="100" height="100">
                                    <s:fill>
                                         <s:SolidColor/>
                                    </s:fill>
                               </s:Rect>
                          </s:Group>
                     </s:mask>
                </s:Rect>
           </s:Graphic>
      

        • 1. Re: [FB4] How to Inverse a Mask using spark??
          Shongrunden Adobe Employee

          I'm not aware of an easy way of doing that.  What I sometimes do is go into Fireworks, draw a square, then draw the mask object on top of it and then combine the objects using a punch.  This will result in a Path with the middle cut out that you can use for a normal mask, for example:

           

          <s:Application  xmlns:fx="http://ns.adobe.com/mxml/2009"
                          xmlns:s="library://ns.adobe.com/flex/spark"
                          backgroundColor="green">
             
              <s:Graphic>
                  <s:Rect width="200" height="200" maskType="clip">
                      <s:fill>
                          <s:SolidColor color="blue"/>
                      </s:fill>
                      <s:mask>
                          <s:Group>
                              <s:Path data="M 75 77 L 125 77 L 125 127 L 75 127 L 75 77 Z M 0 0 L 0 203 L 200 203 L 200 0 L 0 0 Z ">
                                  <s:fill>
                                      <s:SolidColor color="red"/>
                                  </s:fill>
                              </s:Path>
                          </s:Group>
                      </s:mask>
                  </s:Rect>
              </s:Graphic>
                 
          </s:Application>

          • 2. Re: [FB4] How to Inverse a Mask using spark??
            learner_doug Level 1

            Thank you for answering!  I think I need to keep looking for a solution to allow people to "see through" a certain part of the graphic element.

            Take Care!

            Doug

            • 3. Re: [FB4] How to Inverse a Mask using spark??
              learner_doug Level 1

              Thank you.  I think this is as close as I'm going to get.  I think for the number of "masks" I need to effect and my lack of expertise, I'm going to make a number of graphic plates in Photoshop and superimpose them on top of my "lower layer."

               

              I really appreciate your code.

              Doug

              • 4. Re: [FB4] How to Inverse a Mask using spark??
                Mohit M Chavda Level 1

                Is there any way to clip some part of image ?