Project Detail

drag drop action script help  

drag drop action script help is project number 125289
posted at Freelancer.com. Click here to post your own project.

 

| More Free Trial For New Buyers
 

Status:

Selected Providers: FGuru

Budget: $30-100

Created: 02/13/2007 at 9:08 EST

Bid Count: 6

Average Bid:
N/A

02/18/2007 at 9:08 EST

Project Creator: kafl
Employer Rating: 10/1010/1010/1010/1010/1010/1010/1010/1010/1010/10 (7 reviews)

Bid On This Project
 

Description

Hi all

This might be pretty simple....but aparently not for me.

I'm using the below script (off a great tutorial from http://www.hed.swin.edu.au/design/tutorials/flash/drag_drop_tut/index.php) You can see and download fla files here what show what it does.

But i really need it to be able to have multiple targets also.

The essential is that it has to animate to the targets and/or to its start position, in a smooth motion, but I will gladly use any script that does that, where you can easyli change multiple dragable clips and multiple targets. The script should also be able to set different variables when each clip is droppped on each target.


Here's the script.


function dragSetup(clip, targ) {
clip.onPress = function() {
startDrag(this);
this.beingDragged=true;
};
clip.onRelease = clip.onReleaseOutside=function () {
stopDrag();
this.beingDragged=false;
if (eval(this._droptarget) == targ) {
this.onTarget = true;
_root.targ.gotoAndStop(2);
} else {
this.onTarget = false;
_root.targ.gotoAndStop(1);
}
};
//the variables below will store the clips starting position
clip.myHomeX = clip._x;
clip.myHomeY = clip._y;
//the variables below will store the clips end position
clip.myFinalX = targ._x;
clip.myFinalY = targ._y;
clip.onEnterFrame = function() {
//all these actions basically just say "if the mouse is up (in other words - the clip is not being dragged)
// then move the MC back to its original starting point (with a smooth motion)"
if (!this.beingDragged && !this.onTarget) {
this._x -= (this._x-this.myHomeX)/5;
this._y -= (this._y-this.myHomeY)/5;
//if the circle is dropped on any part of the target it slides to the center of the target
} else if (!this.beingDragged && this.onTarget) {
this._x -= (this._x-this.myFinalX)/5;
this._y -= (this._y-this.myFinalY)/5;
}
};
}

dragSetup(circle_mc,targetCircle);
dragSetup(circle2_mc,targetCircle2);


thank you
Karsten Flindt

Messages Posted:1 View project clarification board Post message on project clarification board

Bid On This Project
 

If you are the project creator or one of the bidders Log In for more options

Bids are hidden by the project creator. Log in as the project creator or as one of the bidders to view bids. You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.


    Bid on this Project