Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Let's take a look at the Code Snippets panel. Remember you can access the Code Snippets panel through the panel icon or through Window > Code Snippets. Code Snippets allow you to apply simple interactivity to your applications. The Code Snippets panel is divided up into folders, so you have general actions like clicking to go to a Web page, creating a custom mouse cursor, adding drag and drop interactivity, etcetera. Then you have Timeline navigation. Just like the name implies, these blocks of code enable you to navigate through a Timeline.
Animation allows you to apply ActionScript animation to objects. Load and Unload can load SWF files and images, both from the Library and as external files. Audio and Video allows you to manipulate audio and video. And Event Handlers give you simple interactivity like a mouse click or a mouse over or a key pressed event. Let's just quickly look at one of these blocks of code and I will walk you through how it works once it's entered into the Timeline. Let's say I click Generate a Random Number.
I will just double click that and Flash will automatically create a layer called Actions for me and then write the code in that layer. You can see that there's code in the Actions layer because of the little lowercase A above the blank keyframe symbol. When you put actions inside of a frame, always make sure that actions are on their own layer. I really like to keep my Timeline organized and it's really hard to navigate when you are putting actions and art on the same layer. So I always recommend actions on their own layer and own frame. So let's go back to the Actions panel. Select that frame and open the Actions panel up.
And you will see in the code that Flash gives you information in the form of a comment that tells you how to use the code. So the code is called Generate a Random Number, and then it tells you what the code does and it gives you instructions to use the code. So in this way you can use a random number in your application. So that's just a quick overview of the Code Snippets panel. As you get more experience working with the Code Snippets panel, I recommend experimenting on your own and finding out what kind of interactivity you can add to your applications.
Get unlimited access to all courses for just $25/month.Become a member
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.