0
votes

i have 8 movie Clips that i stored in an array. i put the movie clips on the stage and i can move them around so everything work fine until now. I made a grid where the mc's can be droped.I saved the grid parts in an array,too. after that gave names to the mc's and to the grid parts like that: mc.name= number.toString(); gridpart.name= number.toString(); the movie clips and the grid parts have the same name like: mc1.name=1 and gridpart1.name=1 and so on. Now I made an if statement to check if the right mc was droped on the right grid part, like that:

if(mc.name==gridpart.name)
{
trace("correct position")
}

But nothing happens. I used "dropTarget", too like that:

 if(dropTarget.name==a.target.name)
{
 //code
}

I don't know what to try now. I thought to put this code in the callback function of the mouse.CLICK event handler because i want that the mc should not be moved anymore if it is on hir correct position. I would be happy if you have a better solution for this problem. I tried to describe my problem so that you can imagine what I am trying to say. Sorry about my English, I am not a native English speaker. Thank you for your time

1
Can you add some more code to that. There can be a lot of things going wrong and can you trace mc.name to and grid.name so we know what part is going wrong?. Finally also try using e.currentTarget.name see if that works for you. - Fahim Akhter

1 Answers

0
votes

I think you wrong using dropTarget.name. Try dropTarget.parent.name. This why dropTarget is referred to content of the DisplayObject onto which you release your dragged MovieClip. I hope this will be usefull to you!