Panning image help

Hello :slight_smile:

Im having a bit of trouble on the panning image im working on. Theres a couple things I wanna do to it but im not quite sure how. Im useing partial code form the infinate menu tutorial but added a y axis onto it. Im working with a really big image so Instead of making the image infinate, how would I set up boundries so that the image could scroll to a certain point and then stop when it reaches the end. the map movie code is just this.

onClipEvent (load)
{
xcenter=350;
ycenter=200;

speed=1/20;
}
onClipEvent (enterFrame)
{
var distance=_root._xmouse-xcenter;
_x+=(distancespeed);
var distance=_root._ymouse-ycenter;
_y+=(distance
speed);
}

I also wanted to make it so the camera zooms in at certain points on the image. Any help is very much appreciated as always.

Thanks in advance,
Zach

Use the startDrag() action. You can assign bounds to your clip as parameters; check the actionscript reference. I’m not sure how this would work if you scale the mc (I don’t know if the parameters scale too, but if you are dragging an mc within an mc I think it should work).

When you say camera, do you mean your mouse? You’ll have to come up with some relationship between the mouse position and the center of the clip. To scale the clip, all you need ot do is affect the _xscale and _yscale properties:

[AS]
onClipEvent(enterFrame){
this._xscale = this._xscale*value;
this._yscale = this._xscale;
}
onClipEvent(load){
value = 1;
}
on(press){
value = 1.1;
}
on(release){
value = 1;
}
[/AS]
or something to that effect.

Have a play around and let us all know how you go.

Hey Zach,

http://www.mucreative.com/DragSample.zip

A simple fla with a draggable mc with bounds. I experimented briefly with changing the bounds dynamically but it was becoming a pain in the arse. If anyone else has some clues on this it would be nice.

If I ever get to doing what you want with scaling only certain parts, then I’ll post it here. Until then, play with the drag option.

Chris