all groups > flash actionscript > september 2004 >
You're in the

flash actionscript

group:

stopdrag on xy coordinate



stopdrag on xy coordinate shadx2004
9/26/2004 6:01:48 PM
flash actionscript: I have a MC that will be the iris of the eye so when I have the iris in the
center of the eye (which I will just use the xy) I want it to stopdrag then
load something (Im not worried about that point yet)
this should be simple.

To be a little more specific- the iris is the cursor automatically, there is
no on, over, release, etc.
I just want it to stopdrag once it reaches that specific xy (and once there I
will either have it bring up buttons or load a url)
Re: stopdrag on xy coordinate _jrh_
9/26/2004 6:48:14 PM
Put this on the iris mc.

this.onEnterFrame = function() {
if (this.hitTest(x,y)) {
trace("hit the coordinates");
}
}

The problem with this code is that the registration point has to be EXACTLY on
the coordinates. You should do a hit test against an mc that has maybe a 10x10
size.

Also, you should delete the onEnterFrame function once it touches the
coordinates (if you're not going to use it ever again - if you're going to use
it again, have whatever code you have that starts the drag also instantiate the
onEnterFrame function).
Re: stopdrag on xy coordinate kglad
9/26/2004 6:49:09 PM
it's not clear what you're trying to do, but if you just want an answer it is
to initiate a loop that will poll the iris' (you mean pupil?) position and
trigger whatever events you want if and when that position is reached.

if you want more help, explain what you're trying to accomplish. for example,
what's causing the iris (pupil?) to move is the iris(?) tracking the mouse
position?
Re: stopdrag on xy coordinate shadx2004
9/26/2004 8:55:16 PM
Thanks jrh, Ill try it when I can:)

its the whole inside of the eye (actually a looped video of an atom) I will
try the 10x10 thing. It is the cursor
once its snapped in it will trigger another scene or load the next page.
You can see the after at http://www.shadx.com

Thanks again:)
Re: stopdrag on xy coordinate shadx2004
9/26/2004 8:56:26 PM
Thanks jrh, Ill try it when I can:)

its the whole inside of the eye (actually a looped video of an atom) I will
try the 10x10 thing. It is the cursor
once its snapped in it will trigger another scene or load the next page.
You can see the after at http://www.shadx.com

Thanks again:)
AddThis Social Bookmark Button