Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
One of the more common tasks when working with ActionScript in Flash Pro is to use ActionScript code to manipulate objects on the stage. Now you probably already have experience with this. You have even done that in this title. The easiest way to do that is to give an object an instance name and use that instance name to reference the object in the Actions panel. From the stage here, if I select my border, you will see it's a movie clip, and it has an instance name of boarder_mc. Note that you won't see the instance name field unless you have a particular type of object selected.
Instance names are only applicable to movie clips, buttons, some types of text fields, and components, like the FLV playback component. Note that my instance name is boarder_mc. Instance names are actually variables that are created behind the scenes in Flash, and need to follow the same naming conventions. In other words, you can't start with a number - so you should start with a letter, and you cannot include any spaces or special characters. I've followed this naming convention for a few years now, so I am used to ending every movie clip instance name with _mc.
A movie clip instance name ending in _mc in previous versions of Flash would give you access to instant code hinting. And in this version of Flash, that feature does not exist, so you don't really need to have that in there. That's just something I still do because I am used to doing it. So again, for you, that is optional. Let's go to the first keyframe of the actions layer and open up the Actions panel. So if we want to reference the boarder, all we have to do is type that instance name in our code, boarder_mc. If you want to see what Flash sees when you type boarder_mc, you can trace boarder_mc and test the movie.
You can see that Flash sees an object that is an instance of boarder_4. The boarder part comes from that boarder symbol that we created, and the object is an ActionScript object, which is basically an instance. So again, Flash creates these instances behind the scenes. So that you don't create a conflict, don't create variables with the same names as your instance names, or else Flash may break that connection that you set up by giving an object an instance name.
So to recap, you can apply an instance name to certain types of objects by selecting them and going to the Properties panel. By adding an instance name to an object, you can easily modify that object using ActionScript.
Get unlimited access to all courses for just $25/month.Become a member
61 Video lessons · 104560 Viewers
56 Video lessons · 116482 Viewers
71 Video lessons · 85687 Viewers
131 Video lessons · 41010 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.