Tuesday, July 28, 2009

Here we go: Drag and Drop

Dragging and droppping in flash by turning the pieces in to movie clips we set frames for which the computer was different colors green and yellow corresponding to the paint brushes we had. the code we started with was on the instances themselves

on (press) {
startDrag ("_root.yellow");


///this is what makes you able to grab the brush on press is while you're holding down the mouse button on a on release is of course when you let go of the muse button///


}
on (release) {
stopDrag ();
if (_root.yellow._droptarget == "/computer") {


///if the yellow paint brush is dropped over the computer this instance will go to its internal frame labled yellow where it is painted different color///


_root.computer.gotoandStop("yellow");
}
}
we moved this code to a layer devoted only to action script did the same for a green paint brush and also used some things we learned in character effects to make the selection move to a specific location on screen

No comments:

Post a Comment