Introduction
In this tutorial you will learn how to create a Mr Potato Head "drag'n'drop" flash game.
How To
- Load up Flash and create a new Flash document
- Create a movie-clip, place it on the stage, and give it a name in the properties panel. e.g. "ear"
- Create an invisible button and place an instance of it inside your movie-clip
- Make sure the invisible button is selected and open up the Actions Panel
- Place the following script in the Actions Panel
on (press) {
startDrag(this);
}
on (release) {
stopDrag();
}
- Come out of the movie-clip editor by clicking on Scene1, or by double clicking on the stage
- Test your movie - Hey Presto!! - You should be able to drag and drop your movie clip around the stage.
In my Mr Potato Head example, the above principle was applied to all the other elements, e.g. legs, arms, nose - Easy!
A big thanks to Paul Woodward at TheStableRoom for supplying the graphics!
Downloads