-
I have created a scratch card and now want to attach a coin to the mouse if the mouse is within certain coordinates and have the coin un-attach itself once the mouse leaves the specified coordinates. How do i do this?
I used startDrag ("coin", true, 56.0, 118.0, 272.0, 330.0); but then the user can't click on anything outside of this block.
Please help!
-
have an mc represent the area within which the coin is to attach to the mosue and add this code to it's instance:
Code:
onClipEvent (enterFrame) {
if (this.hitTest (_root._xmouse, _root._ymouse))
{
_parent.coin._x = _root._xmouse;
_parent.coin._y = _root._ymouse;
}
else
{
_parent.coin._x = 0;
_parent.coin._y = 0;
}
}
-
it tells me there are errors in the code?
-
it is lying, there are no errors in my code. There may be errors in where you are using my code though.
-
aahhh... please give me more detailed instructions. My brain is starting to fry! Perhaps if I could send you the file so you can see where my code is etc etc?