# Help with slideshow

**URL:** https://forum.kirupa.com/t/help-with-slideshow/294986
**Category:** Uncategorized
**Created:** [August 23, 2009, 11:50pm UTC](https://forum.kirupa.com/t/help-with-slideshow/294986 "2009-08-23T23:50:29Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![funkwit](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@funkwit](https://forum.kirupa.com/u/funkwit)
#### Post date: [August 23, 2009, 11:50pm UTC](https://forum.kirupa.com/t/help-with-slideshow/294986/1 "2009-08-23T23:50:29Z")

</div>

Hi everyone. I was hoping someone could a newbie with a problem that’s been driving me mad. I’ve got a slideshow which basically consists of one long movie clip symbol which slides from left to right, revealing a total of 6 “slides”. Its all working OK except that I can’t figure out how to stop the slide from moving past the last image or, when I rewind it, stop it from moving back past the first image. Here’s the code I’ve used, if anyone could give me a steer I’d really appreciate it. I wanted to include the FLA bit at 288K, its too big to attach to this thread.

Thanks in advance,  
Marc

import fl.transitions.Tween;  
import fl.transitions.easing.\*;  
import fl.transitions.TweenEvent;

stop();

var xPos:Number = highlifeSlide\_mc.x;  
mask\_mc.x = 0;  
mask\_mc.y = 0;  
highlifeSlide\_mc.mask = mask\_mc;  
var slideWidth:Number = 3600;  
var maskWidth:Number = 600;  
var slTween:Tween = new Tween(highlifeSlide\_mc, “alpha”, Regular.easeIn, 0, 1, 1, true);  
var forwardBtnIN:Tween = new Tween(forward\_btn, “alpha”, Regular.easeIn, 0, 1, 1, true);  
var backBtnIn:Tween = new Tween(back\_btn, “alpha”, Strong.easeIn, 0, 1, 1, true);

var nTimer:Timer = new Timer(100);  
nTimer.addEventListener(TimerEvent.TIMER, checkPosition, false, 0, true);  
nTimer.start();

function checkPosition(e:Event):void  
{  
xPos = highlifeSlide\_mc.x;  
}

forward\_btn.addEventListener(MouseEvent.CLICK, fmClick);  
back\_btn.addEventListener(MouseEvent.CLICK, bmClick);

function fmClick(e:MouseEvent):void  
{  
checkPosition(null);  
var xpTween:Tween = new Tween(highlifeSlide\_mc, “x”, Strong.easeOut, xPos, xPos + 600, 0.5, true);

}

function bmClick(e:MouseEvent):void  
{  
checkPosition(null);  
var xmTween:Tween = new Tween(highlifeSlide\_mc, “x”, Strong.easeOut, xPos, xPos - 600, 0.5, true);  
}
