you compare the _x values of the mcs only once when you release mc1.
when you want to check it while dragging you have to use onEnterFrame.
by the way: as likely as not you will not drag your second mc exactly on the
_x value of your first mc, so you should use an proximation (a region
around
your function control, just run 1 time, only when you release, you
should put it on the mc.onEnterFrame, or start an interval when you
startdrag it
--Pedro Taranto
Gustavo Duenas escreveu:
Hi, I'm trying to stop the drag of a movie click when its x value
equals the x value of other movie
Thanks doctor, I'm going to try this, but a question, why don't
use :Number?
Someone told me that this might be necessary to use numeric values
for x.
is that right?
this.onRelease = function() {
this._parent.MC2.startDrag(true);
}
this.onEnterFrame = function() {
var mc1X: Number =
function compareX():Void
{
if (MC_Drag._x == mc2._x)
{
endDrag();
}
}
function beginDrag():Void
{
MC_Drag.startDrag(false, t, l, b, r);
clearInterval(compareInterval);
compareInterval = setInterval(this, compareX, 10);
}
function
4 matches
Mail list logo