# Before and after question

**URL:** <https://forum.kirupa.com/t/before-and-after-question/328224>\
**Category:** flash\
**Created:** [April 29, 2012, 1:00pm UTC](https://forum.kirupa.com/t/before-and-after-question/328224 "2012-04-29T13:00:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joenowhere](https://avatars.discourse-cdn.com/v4/letter/j/8dc957/32.png) [@joenowhere](https://forum.kirupa.com/u/joenowhere)\
**Post date:** [April 29, 2012, 1:00pm UTC](https://forum.kirupa.com/t/before-and-after-question/328224/1 "2012-04-29T13:00:26Z")

</div>

I’m new in Flash, now I want to make a before and after photo gallery, and each set of photo have a bar in it, so user can click on the bar and slide left and right to see the effect before and after, but the problem is I only know the AC for moving the bar but not with the mask, so did any one know how to make the mask move with the bar? Thanks a lot!

Below is the code I have and the SWF file, please help and thanks!

```auto
slider_mc.addEventListener(MouseEvent.MOUSE_DOWN, drag);
stage.addEventListener(MouseEvent.MOUSE_UP, drop);

function drag(e:MouseEvent):void
{
     e.target.startDrag(false, new Rectangle(0,300,800,0));
}

function drop(e:MouseEvent):void
{
     stopDrag();
}

```

[4shared.com/document/HgJSIDce/Before\_and\_After.html](http://4shared.com/document/HgJSIDce/Before_and_After.html)
