Viewers: in countries Watching now:
In ActionScript 3.0 in Flash Professional CS5 Essential Training, Todd Perkins shows Flash designers how to incorporate ActionScript code into their projects and create interactive presentations and applications. The course includes a review of ActionScript language basics and the object-oriented programming (OOP) methodology, a tour of those Flash Professional CS5 features designed for developers, such as code hinting and the Code Snippets panel, and instructions on interacting with objects in the Library and placing code on the Timeline. Exercise files are included with the course.
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.
Find answers to the most frequently asked questions about ActionScript 3.0 in Flash Professional CS5 Essential Training .
Here are the FAQs that matched your search "" :
Sorry, there are no matches for your search "" —to search again, type in another word or phrase and click search.
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.