PDA

View Full Version : Help with dragging a nested MC around global stage



mindfriction
June 1st, 2005, 12:31 AM
Hi guys,

I have a simple popup dialog box which exists in a movieclip within the timeline of a loaded movie. I would like to be able to drag this dialog within the bounds of the parent movie (i.e. global stage) and not be confined to the dialogs parent clip and ultimately parent movie. ..Hope that makes sense!?

Within my dialog_mc I have a clip called drag_mc which the user clicks to drag dialog (the specifics are below)

Path:
_root.site_mc.gallery_mc.dialog_mc

Registration point:
top left



drag_mc.onPress = function() {
var rbound = Stage.width-this._parent._width;
var bbound = Stage.height-this._parent._height;
this._parent.startDrag(false, 0, 0, rbound, bbound);
};
drag_mc.onRelease = function() {
this._parent.stopDrag();
};
drag_mc.onReleaseOutside = drag_mc.onRelease;


Thanks in advance! :D

mindfriction
June 2nd, 2005, 09:55 AM
Ok, maybe I should simplify my question. This is sitting inside a draggable MC how come it only allows me to drag in the bounds of just the nearest parent? Surely the Stage reference should allow be to drag around my entire project stage!?



drag_mc.onPress = function() {
var rbound = Stage.width-this._width;
var bbound = Stage.height-this._height;
this._parent.startDrag(false, 0, 0, rbound, bbound);
};
drag_mc.onRelease = function() {
this._parent.stopDrag();
};
drag_mc.onReleaseOutside = drag_mc.onRelease;