Drag and drop with targets PROBLEM

I know there are posts on the forums about drag and drop with targets but none of them help me.

I have gone through the tutorials on drag and drop and have successfully made a number of drag and drop flash animations.

HOWEVER…

I can’t get this **** target thing to work and I’m following the tutorial as closely as I can.

Wouls someone please take a look at my FLA / code and try and give me some pointers. I’m getting really fed up of testing the same scene over and over and over and i want to get on with the next one!

thanks!

I could, if you’d upload the .fla :wink:

I can give you an url to the FLA becuase it’s too big to post. Do you have a decent internet connection? It’s about 6mb i think.

it’s here

cheers!

I’ll get right on to it!

Ok thanks.

well this is what I want to do.

When you get it opened you should see a man floating in space. (i suggest you test the scene to see what’s happening) I want that man to be dropped onto the white and blue flashing circle on the right. and when this happens i want the movie to jump to a different frame.

You will see that I have the code for the drag and drop on the MC of the man. and I have the if function on the frame in the timeline. (it doesnt work on the MC either)

I hope you can work it out. I’m sure you can, I’m just new to this stuff thats all.

thanks again.

sorry… I don’t get it to work either…

Ok well thanks for trying anyway Kall,

Does anyone else fancy having a go???

The file will be there at the link above so feel free to try and figure out what the hell is going on with it.

any help would be greatly appreciated!

Whats the code on the man MC?

on (press) {
startDrag (this);
}
on (release) {
stopDrag ();
}

and on the frame in the time line I have:

if (dragman._droptarget == “/blueflash”)
this.gotoandPlay(1);

  1. it wont work because the condition will be only checked once, as the movie starts.
    Place the if statement inside the on(release)
  2. you dont have an instance name for your man MC, how can you reference it?

Ok, I’ve changed the code and put it in the onRelease. it now looks like this:

on (press) {
startDrag (this);
}
on (release) {
stopDrag ();
if (dragman._droptarget == “/blueflash”)
this.gotoandPlay(1);
}

is that alright?

And I’ve given the man and instance name ( i can’t believe I forgot that!) he’s now called “dragman” (like the MC is.)

BUT…

It’s still not working, any ideas why that might be?

What timeline should go to frame 1?

the main one.

Should it have a _root or something along those lines? i was wondering about that.

on (press) {
	startDrag(this);
}
on (release) {
	if (eval(this._droptarget) == _parent.blueflash) {
		_parent.gotoAndPlay(1);
	}
	stopDrag();
}

THANKYOU SO MUCH!!! i’m so very grateful!

welcome :slight_smile: