-
Restricting Stage Width?
I've got some scrolling menu actionScript (courtesy of matbury) that I've incorporated into a project. I've got a stage area of 864x480, but am using a fullscreen background.
What happens as a result is that you can never get to the end of the scroll because of the fullscreen setting. Is there any way set the following actionScript so that it thinks the stage is 864 wide?
Code:
this.onMouseMove = function(){
constrainedMove(bg_mc, 4, 1);
}
function constrainedMove(target:MovieClip, speed:Number, dir:Number){
var mousePercent:Number = _xmouse/Stage.width;
var mSpeed:Number;
if(dir == 1){
mSpeed = mousePercent;
}else{
mSpeed = 1-mousePercent;
}
target.destX = Math.round(-((target._width-Stage.width)*mSpeed));
target.onEnterFrame = function(){
if(target._x == target.destX){
delete target.onEnterFrame;
}else{
target._x += Math.ceil((target.destX-target._x)*(speed/30));
}
}
}