Having trouble with flash builder and masking

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

public function ImageOnStage(bmp:Bitmap)

                    var myShape:Sprite = new Sprite();
                  myShape.graphics.lineStyle(1, 0x000000);
                  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);
                  var bUtil:BitmapUtil =new BitmapUtil();
                  originalBitmap = bUtil.cloneBitmap(bmp);                  
                  this.bitmapImage = bmp;
                  bitmapImage.smoothing = true;
                  this.type = TYPE;
                  this.idImage = ImageOnStage.idCount+".png";
                  image.mask = myShape;

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?
Who is Participating?

Improve company productivity with a Business Account.Sign Up

deepanjandasConnect With a Mentor Commented:
I did not find the image variable declared in your code snippet, may be I am missing something here.
I guess image is a Bitmap, so, try adding the image to another sprite and drag the sprite.

Warm Regards
Deepanjan Das
set this and try:
myShape.mouseEnabled = false;
myShape.mouseChildren = false;

Open in new window

Warm Regards
Deepanjan Das
mhoard8110Author Commented:
thanks for the post.  the bigger issue I have is the:
returns an error in flash builder.  

myShape.startDrag();   and

work, but image.startDrag does not.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.