PDA

View Full Version : drag and drop target in an imported SWF



D-Wiz
May 2nd, 2006, 04:05 AM
Hi All,
I am in a bit of a bind here, I am doing a finals for my Flash class in college and our assignment is to make a portfolio that show cases our past work, well I had made an easter egg hunt SWF where object is to find eggs and drop them into a bucket, main use of action script is the drag and drop target, By itself the SWF runs just fine but when I try to import that swf by method LoadMovie ( I am loading all my shows externally) my drag and drop target breaks. I can drag the egg over to the bucket but it dont "drop" the intial code for the drag and drop is this
code -->
on (press) {
startDrag("");
}
on(release) {

stopDrag();
if (eval(this._droptarget) == _root.EasterBasket) {
setProperty(this, _visible, false)
_root.count --;
tSound = new Sound(this);
tSound.attachSound("thump");
tSound.start(0,0);
}
}
<-- end code
I have tried using the lockroot command to keep the timelines seperate but that didnt help, I changed the _root.EasterBasket to this._parent.EasterBasket to get rid of root reference but that didnt work either. is there a better mousetrap out there that I can use for this drop and drag target that will work when it is imported to another SWF, I need help fast please, this project is due here pretty quick, thanks all, D-Wiz

Breen
May 2nd, 2006, 06:14 AM
send over the fla file please, i 'll have a look at it.

the one with the code shown above in it.

D-Wiz
May 2nd, 2006, 01:03 PM
Here is the FLAs in zip format, there are 2 of them in there the import.fla which is the one that you can drag objects and dop them into a bucket, as you can test it works on standalone but when you import that into a loadmovie it breaks the drop target, I added an FLA for loading external SWF so that you can test.