Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
In this chapter, you're going to be adding ActionScript 3.0 interactivity to your applications. As you may already know, ActionScript 3.0 is Flash's native programming language. In order to use ActionScript 3.0, you need to publish to Flash Player 9 or above. So if Flash Player 8 and below, use ActionScript 2.0. ActionScript can be added in two primary ways. The first way and the way that we'll use in this chapter is through the Timeline. So to apply ActionScript in the Timeline, you can select a frame in the Timeline and then open the Actions panel.
You can find the Actions panel at Window > Actions. As fundamental as writing code in the Actions panel is, I don't want you to think that is the be-all end-all solution for writing ActionScript code. This is really meant for very simple applications. The more code you add to frames, the more convoluted your app can become and it can become very difficult to navigate through your code. So for small amounts of code, Actions panel is perfect. So that's why we're using it in this chapter.
But for large amounts of code, I recommend using the other coding method, which is external class files. So to create a class file, you can just go to File > New and then you can choose ActionScript 3.0 Class. So you click OK and then you can choose whether to edit your code in Flash Professional or Flash Builder. Flash Builder is the superior tool for editing code for an application that you build in Flash. So ideally, you'd be creating ActionScript classes and editing the code in Flash Builder.
If you don't have Flash Builder or you're writing very simple class files, I recommend Flash Professional. I'm going to click Cancel. So just know that those files are text files that contain ActionScript code. That is the advanced way to write ActionScript code for applications. More importantly, it's more scalable, so you can add more code, more complex interactivity, and it's much more easy to manage than it is to manage Timeline code. Throughout this chapter, you'll learn the basics of using ActionScript 3.0 code in your applications.
You'll use the Actions panel and the Code Snippets panel to add little bits of code and you'll learn how to modify that code to make your applications work how you want to.
Get unlimited access to all courses for just $25/month.Become a member
58 Video lessons · 61337 Viewers
61 Video lessons · 93540 Viewers
82 Video lessons · 104387 Viewers
56 Video lessons · 107844 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.