FORUMS: list search recent posts

Drag N Drop HELP

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
David Moore
Drag N Drop HELP
on Mar 20, 2009 at 1:47:07 pm

I’m desperate and need some help with this simple drag and drop. Here is the scenario…this animation is for a kindergarten course. I have 6 different colored teddy bears on the floor and the bears are to be placed on the middle shelf in the room, in no particular order. I have the code in place to drag the bears, and they return to their original location if dropped in the wrong area. Everything works, except I can’t make the bears stick to the target area. The target area has to be the same for all 6 bears. Can someone help me out with this?

I have a feeling that the problem has something to do with my instance names, but I have tried everything I can think of and cannot get it to work. Is there some way I can post, or send my .fla file for someone to look at? I’m desperate. PLEASE HELP!

Return to posts index

Graham Quince
Re: Drag N Drop HELP
on Mar 22, 2009 at 9:23:08 am

It depends on your code, but if your bears are in movie clips and the code is something like:

on release() {
if (this.hitTest(target1)) {
this._x = target1._x;
this._y = target1._y;
} else {
this._x = 100;
this._y = 100;

Then it might be the registration points of your movieclip targets, bears or the possibility is that your targets are too big and the bears are touching more than one target. The hitTest will work even if only 1 pixel of the bear is touching one pixel of the target.

Graham - Free FX for amateur films

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved