PDA

View Full Version : glaring wrong with code?


baileyboop
03-07-2002, 07:01 PM
I'm a newbie to actionscript and the syntax kills me since I'm new to programming.

Is there something wrong with this code? It doesn't give an error but also not doing what I want.

ActionScript Forum helped with the initial concept but I need to take it further and my attempts have failed. Since I'm new I figure this Forum might be better for my simple question.

I need it to:
Count drag and drop
Limit to 4 drags
provide unique message on each of 4 drops and
Snap to original position if dragged to wrong target.

attached is the file.

Any help is appreciated!

-boopy

pinkaboo
03-08-2002, 09:15 AM
Hi, I've had a fiddle and I think I've got it working how you wanted it. Most of your problem seemed to be your pathing, for example your function is on the main timeline so for Flash to be able to read it from within a movieclip you need to tell it to look on the main timeline using _root.moveclip else it looks within the movieclip and obviously can't find it.

Anyhow, hope that helps?

K

jimburton
03-08-2002, 09:47 AM
You should also bear in mind that dropTarget returns a string in flash 4 notation so if you want to compare it to anything you have to go:

if (this._droptarget == "/dragHere")

baileyboop
03-08-2002, 12:03 PM
Thanks....now I can sleep!

Billy T
03-08-2002, 02:03 PM
see attached

cheers