Groups | Blog | Home
all groups > flash actionscript > october 2004 >

flash actionscript : detecting movieclip drag


dr_doug_ross_uk NO[at]SPAM hotmail.com
10/28/2004 3:40:54 AM
just do a hit test for them everyframe
if they're touching make b's alpha drop else keep if full

i.e on A have this code

onClipEvent(enterFrame){
if(this.hitTest(_root.b)){
_root.b._alpha=30;
}else {
_root.b._alpha=100;
}
}

be sure to give b and instance name
David Stiller
10/28/2004 9:13:44 AM
Kapil,

Look into the MovieClip.hitTest() method. You could basically say in an
enterFrame handler, if (clipA.hitTest(clipB)) { ... } to have it to whatever
you like.


David
stiller ( at ) quip ( dot ) net

Kapil Mohan
10/28/2004 11:52:53 AM
Hey all,

This is what I am tryin to do:

I have two movie clips A and B attached by actionscript code. Now, A is
draggable. What I want is that when A drags over B (i.e. user hasnt yet
dropped it on B, just brought A over B), then alpha property of B should
change (decrease ideally). And then when A is dragged away from B, alpha of
B is restored. Any ideas on how to make this possible?

Thanks!
Kapil


AddThis Social Bookmark Button