_droptarget property always returns a path that starts with a slash (/). So use the eval function to convert the returned value from slash syntax to a dot syntax reference.
Code:
// code placed as <movie clip action> on tile_i -
on(press){ startDrag(this,true);}
on (release) {
stopDrag();
if (eval(this._droptarget) == _root.tile_1.Dropzone)
trace("test");
}
nope, it still doesnt work right..... it returns no mater what....
this is what Im using
on (press) {
startDrag(tile_i);
tileSound = new Sound();
tileSound.attachSound("I");
tile = tileSound.attachSound("I");
soundSeq.push("tile");
}
on (release) {
stopDrag();
if (eval(this._droptarget) == _root.tile_i.DropZone)
trace("test");
BUT,
when I try to trace a droptarget from a different file, it works fine!?
this is the other code.
on (release) {
stopDrag();
if (this._droptarget == "/hat") {
trace("test");
_root.hat.gotoAndPlay(2);
}
}
the same does not work for the first case...
I can not do relative pathing for the first .fla for some reason, when I do it, it drags EVEYTHING on the stage as if it were a single symbol..
this is really confusing me.... sorry if Im confusing you guys with this explanation.
oh and all these scripts are written on the button instances themselves.
on (press) {
startDrag(this);
tileSound = new Sound();
tileSound.attachSound("I");
tile = tileSound.attachSound("I");
soundSeq.push("tile");
}
on (release) {
stopDrag();
if (this._droptarget == "/DropZone"){
trace("test");
}
}
why wont this preform both the "trace" and the "push" of the variable on press?
?????????????????????????????????????????????????? ??????????????????????????