PDA

View Full Version : Need help with mc panning



Achillesfrenkel
February 7th, 2007, 04:11 AM
:eye: please, I want to do this http://www.chromazone-imaging.co.uk/flashindex.html
creating a 3d effect, with 2d mc's

and I have this http://www.creativosfrenkel.com/ver2/nueva822d.swf

the .fla file is http://www.creativosfrenkel.com/nueva82.fla

My problem is that i want the mc to move away from the mouse, but if it does, it leavas the stage.
I dont really know too much about actionscript.....
if some body could help me......
pleaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssssssse eeeeeeeeeee!!!!!!

Ayman
February 7th, 2007, 07:35 AM
if(mc._x<0) mc._x = 0
if(mx._x>(Stage.width-mc._width) mc._x = Stage.width-mc._width

Achillesfrenkel
February 7th, 2007, 02:48 PM
Thanks but I dont understad where I have to put that...

the script I'm using is:

onClipEvent (enterFrame) {

//x movement

mx=_root._xmouse;
if (mx<_x) {
dx=_x-mx;
}
else {
dx=mx-_x;
}

moveSpeedx=dx/20;
if (mx<_x) {
_x=_x-moveSpeedx;
}
else {
_x=_x+moveSpeedx;
}

//y movement

my=_root._ymouse;
if (my<_y) {
dy=_y-my;
}
else {
dy=my-_y;
}

moveSpeedy=dy/20;
if (my<_y) {
_y=_y-moveSpeedy;
}
else {
_y=_y+moveSpeedy;
}
}




this is in the movie clip... thanks Ayman!!!