-
Senior Member
No problem. If i'm understanding you correctly, you want the movieclip to be on top of all other clips when it's clicked anywhere, even if the aClip isn't clicked, right?
If that's the case, then use this:
Code:
import flash.geom.Rectangle;
for (var i:uint = 1; typeof(this["dmc_"+i]) != "undefined"; i++) {
this["dmc_"+i].aClip.addEventListener(MouseEvent.MOUSE_DOWN, startD);
this["dmc_"+i].aClip.addEventListener(MouseEvent.MOUSE_UP, stopD);
this["dmc_"+i].addEventListener(MouseEvent.CLICK, mUp);
}
function mUp(evt:MouseEvent):void {
this.setChildIndex(MovieClip(evt.currentTarget), this.numChildren - 1);
}
function startD(evt:MouseEvent):void {
var rect:Rectangle = new Rectangle(0, 0, stage.stageWidth-evt.currentTarget.parent.width, stage.stageHeight-evt.currentTarget.parent.height);
evt.currentTarget.parent.startDrag(false, rect);
this.setChildIndex(MovieClip(evt.currentTarget.parent), numChildren - 1);
}
function stopD(evt:MouseEvent):void {
evt.currentTarget.parent.stopDrag();
}
-
That worked like a charm! You are a genius.
Thank you very much!
-
Senior Member
Thanks, always happy to help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|