| Ultrashock Forums
• Target Drop Area |
|||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
|
|
|||||||||||||||||||||||||
![]() |
Ultrashock Member Comments:
|
2009-11-17
#2 |
||
|
You could use Code:
|
|
|
2009-11-18
#3 |
||
|
I'm sorry Isocase. I guess I didn't make what I'm looking for clear. Rather than typing something like: Code:
If (mouse.x is <= -32 && mouse.x >= 32 && mouse.y <= -32 && mouse.y >= 32) |
|
|
2009-11-23
#4 |
||
|
Well, I had to get my old Trig math book out, but I figured it out. After thinking about it I realize how simple it really is. The mc on the stage is called CenterCirc. Code:
var radDistance = 5000;
this.onEnterFrame = function() {
if (distF(CenterCirc)) {
var cursorDist = Math.round(distF(CenterCirc));
if (cursorDist<=radDistance) {
trace("inside circle");
};
};
function distF(CenterCirc):Number {
return (CenterCirc._x-_xmouse)*(CenterCirc._x-_xmouse)+(CenterCirc._y-_ymouse)*(CenterCirc._y-_ymouse);
};
};
|
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|


3 comments
| 355 views



Linear Mode