I followed the tutorial and all is working perfect. I am currently working on a virtual tour and I am trying to get a button to gotoAndPlay the next scene.
I have tried to insert a button on the movieclip (scrollingimage) with the code to goto the next scene but whenever I do that it will cause the movieclip to flash white and not proceed to the next scene.
Here is the code for the button I inserted:
on (release) {
gotoAndStop("Office", 1);
}
Here is the code for the interactive panning:
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 == 2) {
mSpeed = 1-mousePercent;
} else {
mSpeed = mousePercent;
}
target.destX = Math.round(-((target._width-Stage.width)*mSpeed));
target.onEnterFrame = function() {
if (target._x == target.destX) {
delete target.onEnterFrame;
} else if (target._x>target.destX) {
target._x -= Math.ceil((target._x-target.destX)*(speed/100));
} else if (target._x<target.destX) {
target._x += Math.ceil((target.destX-target._x)*(speed/100));
}
};
}
Any help would be greatly appreciated!
Thanks.