Link to home
Start Free TrialLog in
Avatar of mhoard8110
mhoard8110

asked on

Masking In Flex

I am trying to get an image to move behind a mask in flex.  here is the code:

public function ImageOnStage(bmp:Bitmap)
            {
                  super();

                    var myShape:Sprite = new Sprite();
                  myShape.graphics.lineStyle(1, 0x000000);
                  myShape.graphics.beginFill(0x0000ff);
                  
                  myShape.graphics.lineTo(154.6862, 173.2246);
                  myShape.graphics.lineTo(183.2958, 171.4443);
                  myShape.graphics.lineTo(221.7057, 165.7216);
                  myShape.graphics.lineTo(254.3983, 156.2645);
                  myShape.graphics.lineTo(292.5086, 139.3242);
                  
                  myShape.graphics.lineTo(315.4861, 127.1510);
                  myShape.graphics.lineTo(330.4385, 117.6560);
                  myShape.graphics.lineTo(344.3118, 107.2436);
                  myShape.graphics.lineTo(352.0309, 100.6078);
                  myShape.graphics.lineTo(361.9321, 91.2264);
                  
                  myShape.graphics.lineTo(368.1939, 82.8642);
                  myShape.graphics.lineTo(372.3505, 74.1243);
                  myShape.graphics.lineTo(373.2142, 65.1147);
                  myShape.graphics.lineTo(372.7254, 57.5077);
                  myShape.graphics.lineTo(371.4799, 53.4322);
                  
                  myShape.graphics.lineTo(368.1330, 47.0660);
                  myShape.graphics.lineTo(362.9509, 40.9697);
                  myShape.graphics.lineTo(355.6635, 36.1682);
                  myShape.graphics.lineTo(344.5973, 29.8022);
                  myShape.graphics.lineTo(335.2389, 25.6178);
                  
                  myShape.graphics.lineTo(314.0247, 18.1188);
                  myShape.graphics.lineTo(291.2447, 12.0224);
                  myShape.graphics.lineTo(272.9992, 8.6236);
                  myShape.graphics.lineTo(264.2212, 7.1979);
                  myShape.graphics.lineTo(223.5897, 50.0132);
                  
                  myShape.graphics.lineTo(196.6493, 79.1452);
                  myShape.graphics.lineTo(171.0339, 105.6289);
                  myShape.graphics.lineTo(144.9767, 130.7583);
                  myShape.graphics.lineTo(131.2858, 144.4715);
                  myShape.graphics.lineTo(113.1782, 159.9203);
                  
                  myShape.graphics.lineTo(104.7869, 166.9825);
                  myShape.graphics.lineTo(103.5696, 167.9901);
                  myShape.graphics.lineTo(102.5271, 169.3665);
                  myShape.graphics.lineTo(102.4287, 170.2119);
                  myShape.graphics.lineTo(102.5271, 171.6275);
                  
                  myShape.graphics.lineTo(102.9993, 172.1780);
                  myShape.graphics.lineTo(103.7862, 172.6499);
                  myShape.graphics.lineTo(105.8910, 173.0431);
                  myShape.graphics.lineTo(108.7240, 173.3774);
                  myShape.graphics.lineTo(154.6862, 173.2246);
                  
                  this.addChild(myShape);
                  
                  var bUtil:BitmapUtil =new BitmapUtil();
                  originalBitmap = bUtil.cloneBitmap(bmp);                  
                  this.bitmapImage = bmp;
                  bitmapImage.smoothing = true;
                  this.type = TYPE;
                  ImageOnStage.idCount++;
                  this.idImage = ImageOnStage.idCount+".png";
                  
                  image.mask = myShape;
                  image.startDrag();
}

The issue is the image.startDrag.  It does not work.  How do I make the image scroll behind the mask.  I want the mask to remain fixed.  Anyone?
Avatar of ChristoferDutz
ChristoferDutz
Flag of Germany image

What exactly does not work?

Just a thought. If you have a mask that masks something behind it, you will not be able to click and drag the image behind it if you click on the masked area.
ASKER CERTIFIED SOLUTION
Avatar of ChristoferDutz
ChristoferDutz
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial