I have a movieclip that is: Width:168 and height:25.0
I’ve made some code that when you hold the mousedown it scrolls the movieclip plus or minus across X (horizontal). The only problem I have now is I need it so that when it reaches the edge of the movieclip it doesn’t scroll anymore.
Timeline script:
global.isMouseDown = false;
_global.scrollLeft = false;
_global.scrollRight = false;
var myListener:Object;
myListener = new Object();
myListener.onMouseDown = function() {
_global.isMouseDown = true;
trace("isMouseDown = true");
};
myListener.onMouseUp = function() {
_global.isMouseDown = false;
trace("isMouseDown = false");
}
Mouse.addListener(myListener);
onEnterFrame = function(){
if (scrollRight == true){
animF_mc._x -= 20;
}else{
if(scrollLeft == true){
animF_mc._x += 20;
}
}
}
Button Script:
on (press){
_global.scrollRight = true;
}
on (release) {
_global.scrollRight = false;
}
Any help would be really great as I am stumped on this one.