Hi, I have a Drag&Drop game that works perfectly when viewed alone, but when I import it through a master SWF it wont work. You can drag the items but when you release them on the right droptarget they are all sent back. It´s like it doesn´t recognize the droptargets I think, but Im not sure…[COLOR=slategray](Take a look at the Zip for .fla & .swf)[/COLOR]
Here the two SWF´s:
I have two MC´s called “dt1” and “dt2” which are the droptargets, and six drag items.
[COLOR=red]This is on the first frame in the D&D game:[/COLOR]
var xpos:Number;
var ypos:Number;
function checkMyPos(obj, num) {
if ((obj._droptarget) !== "/"+"dt"+num) {
obj._x = xpos;
obj._y = ypos;
} else {
obj.enabled = false;
}
}
[COLOR=#ff0000]This is on each drag item in the D&D:[/COLOR]
on(press){
this.swapDepths(_parent.getNextHighestDepth());
_parent.xpos = this._x;
_parent.ypos = this._y;
this.startDrag();
}
on(release){
this.stopDrag();
_parent.checkMyPos(this, 1);
}
[COLOR=#ff0000]This is my master SWF script on the first frame:[/COLOR]
I have one MC called “container_mc” that loads the SWF.
function onLoadProgress(target, bytes_loaded, bytes_total) {
target.stop();
target._visible = false;
}
function onLoadComplete(target) {
target.play();
target._visible = true;
}
var loader_mcl = new MovieClipLoader();
loader_mcl.addListener(this);
function startPreload(url) {
loader_mcl.loadClip(url,container_mc);
}
startPreload("dd.swf");
Can anyone help me?