Hi
I have a magnifier made of two movieclips, glass_mc and handle_mc. The glass_mc is a mask revealing an image in a layer below.
Now I want the handle to move like this:
on (press) {
startDrag(handle_mc, false);
}
on (release) {
stopDrag();
}
(See attached example)
But this script can only take care of one movieclip. I want the glass_mc to follow as well,
Hope someone can explain how it should be done.
//Ejrob
it can be done. use->
[AS]
on(press){
mouseX=_root._xmouse
mouseY=_root._ymouse
diffX=_x-mouseX
diffY=_y-mouseY
pressed=true
}
on(release,releaseOutside){
pressed=false
}
onClipEvent(enterFrame){
if(pressed){
_x=_root._xmouse+diffX
_y=_root._ymouse+diffY
_root.glass_mc._x=_root._xmouse+diffX
_root.glass_mc._y=_root._ymouse+diffY
}
}
[/AS]
hope that helped.
Yes it certainly did, thanks a lot.
Would it be too much to ask for an explanation how and why it works?