# Image Slider Pan Thing with ScrollRect

**URL:** <https://forum.kirupa.com/t/image-slider-pan-thing-with-scrollrect/193825>\
**Category:** open source\
**Created:** [July 18, 2006, 5:34pm UTC](https://forum.kirupa.com/t/image-slider-pan-thing-with-scrollrect/193825 "2006-07-18T17:34:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![creatify](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creatify](https://forum.kirupa.com/u/creatify)\
**Post date:** [July 18, 2006, 5:34pm UTC](https://forum.kirupa.com/t/image-slider-pan-thing-with-scrollrect/193825/1 "2006-07-18T17:34:35Z")

</div>

I’m not sure if something like this has been posted, I’ve seen requests, and I’ve seen versions on this site and other sites - anywho.

I created a class file for this, all you need is one movieclip containing your image. It uses scrollRect vs. masking. One note, I’m placing button events on the image clip itself, so if you want to pan a movieclip that contains buttons, you’ll have to create a button clip to handle those events. To initiate:

[AS]  
import com.McSlider;

var myclip:MovieClip = \_root.img;  
var myeasing:Number = .5;  
var myX:Number = 40;  
var myY:Number = 40;  
var myviewW:Number = 720;  
var myviewH:Number = 520;  
var mystartX:Number = ((myclip.\_width - myviewW)/2); //want the image to start centered  
var mystartY:Number = ((myclip.\_height - myviewH)/2); //want the image to start centered

//new McSlider(yourMovieClip, easing, clipX, clipY, aperature\_width, aperature\_height, initial\_x\_Offset, initial\_y\_Offset);  
var nMC:McSlider = new McSlider(myclip, myeasing, myX, myY, myviewW, myviewH, mystartX, mystartY);  
[/AS]

To view:  
[http://flash.creatify.com/experiments/McSlider.html](http://flash.creatify.com/experiments/McSlider.html)

Download:  
[http://flash.creatify.com/experiments/McSlider.zip](http://flash.creatify.com/experiments/McSlider.zip)

\*\*\*\*\*\*\*EDIT 09.07.06:  
I’ve uploaded a version that accepts buttons within the movieclip - enjoy:  
\*\*  
\*\*VIEW: \*\*  
[http://flash.creatify.com/experiments/McSliderB.html](http://flash.creatify.com/experiments/McSliderB.html)  
\*\*DOWNLOAD: \*\*  
[http://flash.creatify.com/experiments/McSliderB.zip](http://flash.creatify.com/experiments/McSliderB.zip)

\*\*\*\*\*\*\*EDIT 12.12.06  
I’ve uploaded a version that with 3 new public methods:  
stopMotion();  
startMotion();  
slideToPoint(x,y);  
\*\*  
\*\*VIEW: \*\*  
[http://flash.creatify.com/experiments/McPan.html](http://flash.creatify.com/experiments/McPan.html)  
\*\*DOWNLOAD: \*\*  
[http://flash.creatify.com/experiments/McPan.zip](http://flash.creatify.com/experiments/McPan.zip)

---

<div class="post-metadata">

**Author:** ![howardf](https://avatars.discourse-cdn.com/v4/letter/h/eb8c5e/32.png) [@howardf](https://forum.kirupa.com/u/howardf)\
**Post date:** [October 25, 2006, 1:57pm UTC](https://forum.kirupa.com/t/image-slider-pan-thing-with-scrollrect/193825/2 "2006-10-25T13:57:12Z")

</div>

This is great, but is there anyway it will work in MX 2004?

---

<div class="post-metadata">

**Author:** ![Brenda\_\_](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@Brenda\_\_](https://forum.kirupa.com/u/Brenda__)\
**Post date:** [October 26, 2006, 12:12am UTC](https://forum.kirupa.com/t/image-slider-pan-thing-with-scrollrect/193825/3 "2006-10-26T00:12:22Z")

</div>

Hi Creatify, that’s a really nice job u made!! i just wanted to ask u if it’s possible to stop the scroll when i click on a button and then re-start the scroll exactly from the point where the button is (ie where i clicked) (sorry if my question has been asked)  
Thank in advance 🙂

---

<div class="post-metadata">

**Author:** ![yellowsubmarine](https://avatars.discourse-cdn.com/v4/letter/y/848f3c/32.png) [@yellowsubmarine](https://forum.kirupa.com/u/yellowsubmarine)\
**Post date:** [June 18, 2008, 4:42pm UTC](https://forum.kirupa.com/t/image-slider-pan-thing-with-scrollrect/193825/4 "2008-06-18T16:42:22Z")

</div>

Creatify, simply brilliant.

Thanks! :party:
