-
drag object only left to right
I'm new to actionscript. I have figured out how to make an MC draggable however I am trying to restrict the movement. I am trying to make a MC draggable only left to right or right to left but not up or down. I assume this is very simple but I can't seem to figure it out.
Any help will be greatly appreciated.
Thanks,
redfred1969
-
Hey there redfred1969!
One quick qestion do u want it to follow it all the time? cause if u do then add this to the MC
onClipEvent(enterFrame){
this.x=_root.xmouse;
}
-
or on mousedown:
onClipEvent(mouseDown){
this._x=_root._xmouse;
}
you also can check with hittest if the mouse is above the mc, insert this in an if-loop and it will only drag when your mouse is over the mc.
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
|