• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Lesson 13. Drag-and-Drop Interactions > Making the Remaining Monsters Draggable

Making the Remaining Monsters Draggable

You're done working with Chiron. Its functionality is complete. You now need to apply this script to the remaining three monsters. You can copy and paste the script, since almost all of it is the same for each of the remaining monsters, with the exception of a few of the particulars. In this task, you will copy and paste the script for the remaining three monsters, and you will customize each script as appropriate.

1.
Drag out three new instances of monsterTarget. Using the Property inspector, place one at X 27, Y 0, and give it an instance name of fury_targ_mc. Place another at X 372, Y 168, and give it an instance name of geryone_targ_mc. Place the third at X 247, Y 345, and give it an instance name of lucifer_targ_mc.

Before you can do the other monster's hit tests, you need to create and position the targets and give them all instance names.

2.
Select Frame 10 of the actions layer, open the Actions panel, drag to select the entire Chiron script, and copy it to the Clipboard. Position the cursor just below the end of the Chiron block and paste in the code.

Now you are ready to modify this code as needed for the lucifer_mc instance.

3.
In this code block, change all instances of chiron_mc to lucifer_mc, and likewise change chiron_targ_mc to lucifer_targ_mc. Change the first set of X, Y positions to _x=251 and _y=347. Change the second and third set of X, Y positions to x=608, y=344. Finally, change the text-feedback code in the line that begins _root.dragtext.htmlText= to the following:

_root.drag_txt.htmlText="<b>Correct!</b><br>Lucifer is entombed upside-down in a frozen lake.";


					  

These are all the changes necessary to customize this movie clip to the monster Lucifer. The hitTest() action now looks for the correct target; the positioning is adjusted so it snaps to the correct position; and the feedback text is updated to show the appropriate feedback.

4.
Repeat Steps 2 and 3 for the monster Geryon (the lizard-man). Change the instance name to geryon_mc. The first hitTest() should specify geryon_targ_mc. Change the first set of X, Y coordinates to x=375 and y=172. Change the other two sets of X, Y coordinates to x=656 and y=349. Finally, the text-feedback line should be as follows:

_root.drag_txt.htmlText="<b>Correct!</b><br>Geryon is the vehicle of choice for those headed to Circle 8 and below.";


					  

In this step, you are customizing the script for the monster Geryon.

5.
Repeat Steps 2 and 3 for the monster Fury (the snake-haired woman). Change the instance name to fury_mc. The first hitTest() should specify fury_targ_mc. Change the first set of X, Y coordinates to x=29 and y=2. Change the other two sets of X, Y coordinates to x=706 and y=344. The text-feedback line should be as follows:

_root.drag_txt.htmlText="<b>Correct!</b><br>The snake-headed Furies guard the walls of Dis.";


					  

In this step, you customize the fourth and final monster, the Fury.

6.
Test the movie, and try dropping each monster on its target, on an incorrect target, and on the start area. In all three cases, the monster should snap into position and the proper text feedback should appear in the drag_txt text field.

Each monster should have three unique responses, depending on where it is dropped. In addition, each should respond appropriately to its own target. If something went wrong, go back and compare your scripts with those in the directions and screenshots.

NOTE

Do not skip this step! Momentarily, you will switch to Dreamweaver and insert the Flash movie into its HTML document. By testing the movie, you generate a SWF from the completed version of the file. If you skip this step, you'll wind up inserting an unfinished copy of the SWF file.

7.
Save the FLA and close Flash.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint