can anyone explain to me why this code returns no matter where I drop the object (not just "DropZone")
on (release) {
stopDrag();
if (tile_i._droptarget == tile_1.DropZone)
trace("test");
}
Thanks
Printable View
can anyone explain to me why this code returns no matter where I drop the object (not just "DropZone")
on (release) {
stopDrag();
if (tile_i._droptarget == tile_1.DropZone)
trace("test");
}
Thanks
Is this piece of code placed on the tile_i?
_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");
//if (tile_i._droptarget == "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.
here is the .fla
Never mind my last rant!
I guess the object has to be a MC, cant be a BTN, for the path to work!
(I learnt something new!!)
Cheers!
AHHHHH!!! now it wont push the variable!!!
im more confused than ever......................
HELP!!!!!
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?
?????????????????????????????????????????????????? ??????????????????????????