Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Swing Back

Status
Not open for further replies.

gashed99

Technical User
Apr 6, 2001
15
FR
I am currently working on Drag-Drop interface. I need some help on a piece of action script:

I am trying to make my draggble object return to its original position if the object is not placed on the target, to add to this piece of code

code:

on (press) {
this.startDrag(false);
}
on (release) {
this.stopDrag();
if (this.hitTest (_root.target)) {
this.stopDrag();
this._visible = false;
_root.target.nextFrame();
}
}

At the moment the object just stays where you last had it.

here is the example at the moment:


If any one could help on this I'd be most grateful.
There's more in heaven and Earth than dreamed of in our philosophy!
 
If the hit test is wrong, bad, or whatever... Can't you just go back to the frame where the object was in it's original position... Otherwise move on!
old.gif
 
Thanks Dave this has really helped me out.

Regards

JIM There's more in heaven and Earth than dreamed of in our philosophy!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top