Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
The first step in writing the code for this app is to create the DragDrop class and the Map class. The first thing we'll do is create the Map class. I'll do this by deselecting everything and then going over to the Class area in the Properties panel and by clicking Edit class definition. This will open up a window for creating a new ActionScript class. I'll choose Flash Professional as my editor, and for the Class name, I'll type Map.
And then I'll click OK. Since I clicked that button from the Properties panel for the document class, Flash already knew that I wanted to extend the MovieClip class and added the import line of code for me. I'll click the button to auto format the code, save the file. Flash automatically goes to the same directory I am in, and automatically gives me the appropriate file name, which is the same name as my class.
So I click Save As, and the file is saved. Now to click the DragDrop class, I'll go to File > New, choose ActionScript 3.0 Class, and then click OK. I'll choose Flash Professional for my editor and then type DragDrop, capital D's. I'll autoformat this file, and now I'll import some code.
So I import flash.display.*. So import all of the display object classes. Remember, that's what that wildcard does. So one of the display classes is MovieClip. Then I'll import all the event classes. So import flash.events.*. Then I'll extend the DragDrop class for this. All of these draggable elements are just one frame, so I can use the Sprite class instead of the MovieClip class, to have optimized code.
So I'll save the file. Flash will automatically name the file for me. So I'll just click Save As. One more thing I want to do is import some additional code into the Map class. So I'll go back to the Map class. I'm going to import all of the display classes and all the event classes, as well. So I can actually highlight those two lines of code I just wrote in DragDrop, copy them with Command+C or Ctrl+C, go over to the Map file, highlight the import line of code that's already there, and then paste the code with Command+V or Ctrl+V. Now again, make sure to save this file after you change it.
So now we've set up the basic classes that we're going to be using for this application.
Get unlimited access to all courses for just $25/month.Become a member
61 Video lessons · 92347 Viewers
82 Video lessons · 104108 Viewers
71 Video lessons · 75500 Viewers
56 Video lessons · 106883 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.