all groups > flash actionscript > march 2005 >
You're in the

flash actionscript

group:

Mouse reacting movie clip: urgent.



Mouse reacting movie clip: urgent. PaulAnka
3/15/2005 9:21:33 PM
flash actionscript: Hello, I have a movie clip of, let's say. 1000 pixels wide and 30 pixels high.
My movie is 770 pixels wide. I want that if my mouse is over the movie clip I
can move to movieclip with it (not with click, just reacting on the mouse) If I
move the mouse to the left, the mc moves to the right (until the beginning of
the mc is on the left side of the movie), and if I move the mouse to the right,
the mc moves to the left (untill the end of the mc is on the right side of the
movie). How can I do this? Thanks, Paul
Re: Mouse reacting movie clip: urgent. fasterthanlight
3/16/2005 1:11:09 AM
I made an application that does what you want, but both vertically and
horizontally. you can view it at:
http://jamieroy.com/gallery/jamieroy/photo.html (it takes a long time to load,
picture is huge) the code you would want is something like this:

onClipEvent(enterFrame){
if(this.hitTest(_root._xmouse, _root._ymouse)){
this._x += (_parent._xmouse)/(-10);
} else{
this._x += 0;
}
}

slap that onto the clip that you want to scroll, and then convert taht to
another movieclip. I'm not sure how you would go about stopping it from moving
when it reaches the end, the way i did it for my application is reallllllly
complicated, perhaps if you put a conditional statement that says if the
movieclip's x position is less than ___________ (the x co-ordinate where the
clip should stop) then move it using the script below.
AddThis Social Bookmark Button