I’m new to flash and this forum. I’m using Flash MX on a Mac in my studio. I come from a background of PHP programming, so that seems to help with learning Actionscript, but not with the particulars of Flash.
I have a client that needs a scrollable panaramic image, somewhat like what you see in Quicktime VR, only more simple (only left - right scroll, no zooming). I found a tutorial here that got me started with the left-right scroll when the mouse enters the live area, and even modified the script to accelerate/decelerate. But, what I really want is to be able move the cursor into the live area, but nothing happens until you click and drag. Then, when the mouse button is down, and you move left or right, the image scrolls (similar to Quicktime).
My script now starts with ‘onClipEvent(enterFrame)’. I tried ‘onClipEvent(MouseDown)’ but then the scrolling only works when you click and release. Can anyone help me with this? I’ve searched for tutorials, and all I can find is ‘startDrag’ and such, but I couldn’t figure out how to make that work. Here’s my current code, starting with the ‘infinite_start’ tutorial found on this site:
[AS]
onClipEvent (enterFrame) {
if (_root._xmouse < 20 || _root._xmouse > 280 || _root._ymouse < 20 || _root._ymouse > 130) { // mouse position is OUTSIDE the live area
decel = decel - decel_amount; // create a deceleration value
if (decel < 0) { // keep the deceleration value at 0 so the movement doesn’t reverse
decel = 0;
}
} else { // mouse position is INSIDE the live area
decel = decel + decel_amount;
if (decel > 1) {
decel = 1;
}
}
var xdistance = (_root._xmouse-xcenter)decel; // how far to move the movie clip
_x -= (xdistancexspeed); // actually reposition the movie clip
if (_x > 0) { // test is the movie clip needs to loop
_x = -300;
}
if (_x < -300) { // test is the movie clip needs to loop
_x = 0;
}
}
[/AS]
Thanks very much,
Dan