To attach a file here, look near the bottom of the page when posting. You'll see a section for attaching a file. You'll see a browse button.
This is really a moderate to advanced kind of project. It's a good idea to have the basics down when it comes to Flash... knowing about the three symbol types and how they work, knowing about how variables interact and how to access properties.
If ya don't know that stuff by heart, read up! Do the lessons provided in the Flash Help menu.
To guide you in the right direction, check this out.
Define an area around which you want the clip to "snap" to... make sense? Like, if the user drops the heart NEAR the area it should be, then it goes into place... otherwise it gets a buzz.
To define that box, draw a rectangle around the area and jot down the 4 coordinates: left, right, top, and bottom.
Define some variables on your draggable movie clip(s). Lookie here:
- snapX1 - Left corner of the snap-to box
- snapX2 - Right corner of the snap-to box
- snapY1 - Top of the snap-to box
- snapY2 - Bottom of the snap-to-box
- snapX - The X coordinate of the snap
- snapY - The Y coordinate of the snap
See those snap variables? They are used when the dragged clip is released. Have an if statement check to see of the clip was dropped within the boundaries of the snap-to box. If it was, have it "snap" to the designated coordinates. The code would look something like this...
Code:
on(release, releaseOutside) {
if (((this._x >= snapX1) && (this._x <= snapX2)) &&
(this._y >= snapY1) && (this._y <= snapY2))) {
this._x = snapX;
this._y = snapY;
}
}
That help any?