Add Code for each Draggable Item in Flash
● Copy your existing code and duplicate it for each Draggable item in Flash.
✓ Actionscript 3 ✓ Movie Clips ✓ Keyframes ✓ Actions Panel
• This is the 2nd tutorial in the Drag and Drop Project.
Other People's Work:
Here are examples of work inspired by this tutorial.
Step #1: Your 2nd Draggable Item in Flash ~
✗ Hopefully you've done this tutorial first …
✗ Click your 2nd draggable item.
✗ Make a Movie Clip out of your draggable item by highlighting it and hitting F8 and call it item2_mc
✗ Make sure you type the name PERFECTLY item2_mc
Step #2: Name the Instance - AGAIN ~
✗ In the Properties menu set the instance name:
✗ Name the instance:
Step #3: View the Actionscript ~
✗ Click on your Actions and Labels keyframe …
✗ … hit Alt (⌥) F9 - and open the Actions panel …
Step #4: Add some Space ~
✗ Then hit Enter several times to clear some space …
Step #5: Copy the Code ~
✗ Copy the first 2 lines of code and paste it below with a space in between …
✗ Then change the code to item2_mc like this …
Step #6: See if it Works!
✗ Hit Cmd (⌘) + Enter and move your object!
Step #7: Wash, Rinse and Repeat ~
✗ Each draggable item must be:
‣ Turned into a Movie Clip (F8)
‣ Changed Instance Name
‣ Add 2 new lines of code for each draggable item in the Actions and Labels panel …
✗ Again, if you've got only 3 draggable objects, you will need to remove EVERYTHING referencing item4_mc, item5_mc, item6_mc and item7_mc
✗ If you've got MORE than 7 items, you will have to add those accordingly.
✗ If you're ready, keep working on your Origin Code …
Last Step: Save and View your work ~
✗ View your work by hitting the keyboard shortcut: Cmd(⌘)+Enter
✗ Save your work as - FIRST_NAME_LAST_NAME_PROJECT_NAME.fla]
• ALWAYS save your projects using the following naming convention:
• DO NOT name your project any other way - Improperly named projects will not receive credit and you will be sad.
• NEVER leave your work on the desktop or depend on a flash drive - instead, save your work in a folder you can find later - preferably on a virtual drive where it can be backed up.