Dragging and dropping a button is very easy in flash. Using this dragging and dropping method, you can create many games, puzzles and more. Follow the steps below to make a button draggable and droppable.
Creating a button :
- Create a square and convert it to a button by selecting the square and choosing “Choosing convert to symbol” from the “Modify” menu.
- Name the square, choose the type “Button” and click “Ok” from the “Convert to symbol” window.
- Your button is now ready.
- Below is a sample button created by me.
Instance name for the button :
- The main part of this tutorial is to give a “Instance name” for the button.
- You can enter the “Instance name” for the button in the “Properties” window (shortcut key- Ctrl+F3).
- Enter the instance name for the button as “box”
- Here’s a sample picture on how it will look after entering the instance name
Adding some script :
- Add the following script to the button in the “Actions” window (shortcut key- F9).
on (press) {
startDrag("_root.box");
}
on (release) {
stopDrag();
}
Your draggable button is now created. Press Ctrl+Enter to test the movie. Click and drag the button. Enjoy !
Add your comment 1 Comment so far