Hi all. I have an actionscript question that I’m hoping someone can help me out with. I’ve built (with help from these forums) an image scroller but I’d like to make the ‘next’ and ‘previous’ buttons invisible at the first and last frames frames respectively. The code I’m using for the scroll is below. I think the code I’m after should be something like this:
if (targetX<720) {
btn_Previous.visible = false;
}
But I can’t work out where I should put it (or even if it’s correct) within the scroller code.
stop();
var targetX:Number = 0;
var speed:Number = 6;
m_Images.onEnterFrame = function() {
this._x += (targetX-this._x)/speed;
};
btn_Next.onRelease = function() {
if (targetX>-8640) {
targetX -= 720;
}
};
btn_Previous.onRelease = function() {
if (targetX<0) {
targetX += 720;
}
};