# Interactive Image Panning & Alpha Channel Masking

**URL:** <https://forum.kirupa.com/t/interactive-image-panning-alpha-channel-masking/238836>\
**Category:** flash\
**Created:** [September 16, 2007, 12:29am UTC](https://forum.kirupa.com/t/interactive-image-panning-alpha-channel-masking/238836 "2007-09-16T00:29:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![genizah](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@genizah](https://forum.kirupa.com/u/genizah)\
**Post date:** [September 16, 2007, 12:29am UTC](https://forum.kirupa.com/t/interactive-image-panning-alpha-channel-masking/238836/1 "2007-09-16T00:29:16Z")

</div>

hi all again,  
i have a problem with Interactive Image Panning & Alpha Channel Masking. without panning codes masking is working but with panning i can’t see my masked area. code is below and icant find where i am wrong or what i am missing, thank you…

```auto
maske.cacheAsBitmap=true
bg_mc.cacheAsBitmap=true
bg_mc.setMask(maske);
bg_mc.onMouseMove = move;
bg_mc.onMouseMove = null;
bg_mc.onRollOver = function() {
    this.onMouseMove = move;
};
bg_mc.onRollOut = function() {
    this.onMouseMove = null;
};
function move() {
    constrainedMove(bg_mc,4,1);
}
 
function constrainedMove(target:MovieClip, speed:Number, dir:Number) {
 var mousePercent:Number = this._ymouse/400;
 var mSpeed:Number;
 if (dir == 1) {
  mSpeed = 1-mousePercent;
 } else {
  mSpeed = mousePercent;
 }
 target.destX = Math.round(-((target._height-400)*mSpeed));
 target.onEnterFrame = function() {
  if (target._y == target.destX) {
   delete target.onEnterFrame;
  } else if (target._y>target.destX) {
   target._y -= Math.ceil((target._y-target.destX)*(speed/100));
  } else if (target._y<target.destX) {
   target._y += Math.ceil((target.destX-target._y)*(speed/100));
  }
 };
}

```
