0 Replies Latest reply on Sep 15, 2011 2:49 AM by pauland

    Masking draggable content

    pauland Level 4

      I have a group with a mask, containing another draggable group.

       

      The mask does work, but dragging the nested group drags it outside of it's parent and the clipping seems to be relevant to the nested group not the parent. I basically want to drag around the "contentPlane" group and have it masked with it's parent. Currently it does clip, but dragging goes outside the parent and it looks like the content of contentPane is masked and the mask is being dragged with it.


      I anticipate a Doh moment.

       

      Paul

       

      Currently it looks like this:

       

      <?xml version="1.0" encoding="utf-8"?>

       

      <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"

       

               xmlns:s="library://ns.adobe.com/flex/spark"

       

               xmlns:mx="library://ns.adobe.com/flex/mx"

       

               maskType="clip"

       

               >

       

          <fx:Declarations>

       

              <!-- Place non-visual elements (e.g., services, value objects) here -->

       

          </fx:Declarations>

       


          <s:mask>
              <s:Graphic>
                  <s:Rect
                      width="{this.width}"
                      height="{this.height}">
                      <s:fill>
                          <s:SolidColor color="0xFFFFFF"/>
                      </s:fill>
                  </s:Rect>
              </s:Graphic>
          </s:mask>

       


          <s:Group id="contentPlane" clipAndEnableScrolling="true" width="100%" height="100%"
                    mouseDown="this.startDrag()"
                    mouseUp="this.stopDrag()"
                    mouseOut="this.stopDrag()">

       


          </s:Group>
         
          <!--s:Label text="{_orgMode}" /-->
      </s:Group>