-
eveningtidemusic.com
Constrain mask drag
Hi,
I am dragging a mask MC with the below code however I would like to contrain the x values to between 200 and 600 but can't get me head around it. Any ideas? Thanks.
code:
onClipEvent (enterFrame) {
_x += (_parent._xmouse-_x)*.15;
}
-
Between Flash & Flashkit
hey try this on your mc ..with the instance name dragger_mc..
Code:
//dragger_mc instancename
dragger_mc.onPress = function() {
//self explanitory
startDrag(this, true, 200, 50, 600, 50);
//trace to get y position ,change it to x to get that positio
trace("_root.dragger_mc._y"+_root.dragger_mc._y);
};
dragger_mc.onRelease = function() {
stopDrag();
};
I want to learn .
wannabe flasher [ Actionscript 2.0 ]
-
eveningtidemusic.com
The code posted by timothye doesn't work for me. (thanks for the help though tim)
I like the code I have because the mask MC just follows the mouse w/a smooth ease to it and there is no clicking needed by the user. Any other ideas on contraining this mask drag? Thanks.
-
onClipEvent (enterFrame) {
if(_x<600&&_x>200){
_x += (_parent._xmouse-_x)*.15;
}
}
-
eveningtidemusic.com
The code posted by rdoyle720 is almost exactly what I need. The problem is when the MC reaches the boundries it just 'dies' and can't be dragged anywhere else. Any ideas? Thanks again.
-
Are you actually dragging the clip, or just making it move toward the mouse?
-
eveningtidemusic.com
I guess technically you could say I am just making the MC follow the mouse (w/easing).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|