Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
In this chapter I'm going to explain what functions are and how to use them. If you'd like to follow along with this movie this file is in the chapter 3 Working Files folder and it's called Functions.swf. So feel free to open that if you want to follow along. A function is a reusable block of code. So let's say this is a block of code right here, this big block in the middle of the screen. And I want to modify properties of my boarder, which is right at the bottom right of the screen. So I would drop the boarder inside of the function to apply a function to the boarder.
I'm going to modify his rotation, and then modify his movement. Now if I click run function, he'll move and rotate. So let's just click this reset button and try again. I'm going to drag the boarder in there, cause we need to apply to the boarder. And let's just say I want to only move him. Run the function, moves, run the function, moves. Now let's say if I want to only rotate the boarder. So I'm just going to toss the rotate block inside of the block of code, and then run the function, and that will just rotate the boarder and not move the boarder.
So again a function is a block of code that we can use over and over and over again. So let's learn how to write them in the next movie.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 101462 Viewers
61 Video lessons · 88220 Viewers
71 Video lessons · 72102 Viewers
56 Video lessons · 103858 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.