Hi… I’m working on a site that utilizes a draggable MC as the background/navigation with easing, to simulate underwater movement…
The problem I’m having is setting the MC’s boundaries… I’ve been able to set up specific x/y boundaries, but I’ve lost the easing effect with everything tried. Also, I would like the boundaries to set relative to the browser window size, so that the user can always maneuver the whole background (and, of course, not move the background off the screen…).
Any help would be greatly appreciated… I feel like I am just missing it with every attempt.
Here’s what I have so far: underwater.swf
And here’s my code…
on first frame:
Stage.align = "CC";
Stage.scaleMode = "noScale";
stop();
on my background MC, ‘object_mc’:
onClipEvent (load) {
xfinal = _x;
yfinal = _y;
}
onClipEvent (enterFrame) {
if (drag) {
x = _root._xmouse+xd;
y = _root._ymouse+yd;
} else {
x = xfinal+xd;
y = yfinal+yd;
}
_x = _x+(x-_x)/5;
_y = _y+(y-_y)/5;
}
on my button inside the background MC:
on (press) {
drag = true;
xd = _x-_root._xmouse;
yd = _y-_root._ymouse;
Mouse.show();
}
on (release, releaseOutside) {
drag = false;
xfinal = _root._xmouse;
yfinal = _root._ymouse;
Mouse.show();
}