I’m building a drag and drop thingy that has multiple attached movies via buttons. Within those attached movies are other attached moives that get called via AS. I need to attach the inner ones via AS in to remove them and swapDepths.
The problem. When I drag the parent mc, the inner ones get attached again when I release the parent. Its like the code gets fired again onRelease :huh:
Any one have an run into this problem?
stop();
var rotateMe = 1;
var scaleInterval;
box.gotoAndStop(1);
box.useHandCursor = false;
box.onPress = function() {
_root.setDepth += 2;
this._parent.swapDepths(_root.setDepth);
this._parent.startDrag(this.false,6,57,(_root.current_mc.bounding_box._width)-(this._width+16),(_root.current_mc.bounding_box._height)-this._height-9);
_root.selected_mc.gotoAndStop(1);
_root.selected_mc = this._parent;
gotoAndStop(2);
};
box.onRelease = box.onReleaseOutside=function () {
this._parent.stopDrag();
this._parent._x = Math.floor(this._parent._x);
this._parent._y = Math.floor(this._parent._y);
};
function scaleIt() {
if (scaler._x<0+scaler._width) {
scaler._x = 0+scaler._width;
}
if (scaler._y<0+scaler._height) {
scaler._y = 0+scaler._height;
}
box._width = Math.round(scaler._x)+3.5;
box._height = Math.round(scaler._y)+3.5;
box2._width = Math.floor(box._width-10);
box2._height = Math.floor(box._height-10);
}
scaler.onPress = function() {
_root.setDepth += 2;
this._parent.swapDepths(_root.setDepth);
_root.selected_mc.gotoAndStop(1);
_root.selected_mc = this._parent;
gotoAndStop(2);
scaler.startDrag();
scaleInterval = setInterval(scaleIt, 10);
};
scaler.onRelease = scaler.onReleaseOutside=function () {
stopDrag();
_root.selected_mc = this._parent;
gotoAndStop(2);
clearInterval(scaleInterval);
if (box._width<50) {
box._width = 50;
box2._width = 40;
scaler._x = 50;
}
if (box._height<50) {
box._height = 50;
box2._height = 40;
scaler._y = 50;
}
};
var couchAd = this.attachMovie("couch","couchA",this.getNextHighestDepth());
couchAd._x=23;
couchAd._y=76;