all groups > flash actionscript > december 2004 >
You're in the

flash actionscript

group:

droptarget mc problem


droptarget mc problem Mike7222
12/18/2004 7:53:47 PM
flash actionscript:
Hi THERE,

I have a problem that is driving me crazy! I will explain it the best I can.

Situation:

6 Draggable mc's
4 fixed mc's (these act as dropping zones for the draggable clips)

When the user takes the 1st drag mc and drops it on a drop mc, a copy of the
drag mc (as a new movieclip instance)
is created and placed on the drop area (to give the impression that they
dropped the clip there).
The original mc that they dragged is then put back in its original place ready
to be dragged again elsewhere.
To achieve this, I am using _droptarget to obtain the instance name of the
dropzone that is used for various
variables.

I am able to drop and cover the mc fine, the problem occurs when I attempt to
drop another drag mc on a drop mc that
has already had something dropped on it previously. I cannot attain
_droptarget at this point because the drop mc
is covered by the instance that was created previously.

Here is what I have thought of to try and fix this:

I thought of creating an array for each drop mc. It records the name if the
instance covering the drop mc, then when
the user goes to drop another drag mc on it, I reference the name of the
instance currently in place from the array
associated with the drop mc and then remove it via removeMovieClip. The
problem is, the only way I know where the
user will drop the next drop mc is when onRelease is activated, and by that
time it is too late to register the
_droptarget var which I need, so really I need to remove the mc before the
user does onRelease, but this is a catch 22 situation.
Anyone know anthing that could help? Did I explain this ok?

Thanks for any advise offered.

Cheers

Mike
Re: droptarget mc problem kglad
12/18/2004 10:11:54 PM
Re: droptarget mc problem Mike7222
12/19/2004 3:41:36 PM
thanks alot. It sorted the problem. Quite a straight forward solution now you
pointed it out. I had not used alpha property before (didnt even know what is
was for, still early days for me)..
Thanks again,

Mike
Re: droptarget mc problem kglad
12/19/2004 3:48:35 PM
AddThis Social Bookmark Button