Viewers: in countries Watching now:
Taking the principles and skills taught in ActionScript 3.0 in Flash CS3 Professional Essential Training, Adobe Certified Instructor Todd Perkins demonstrates how to put them to practical use in this course. Todd fully explores ActionScript's most powerful features, including creating advanced navigational interfaces and special effects using XML data and adding accessibility to files via closed captioning. Exercise files accompany the tutorials.
In the last movie you learned how to put a visual element on the stage. In this movie you'll learn how to take a visual element off of the stage using something called removeChild. If you're following along, I am in Remove _Child.fla and that's in the Chapter 1 folder within the Exercise Files. Let's take a look at how this file is setup. We have the Button layer and the actions layer and you can probably guess what's on the Button layer. That's the button. Let's see what's in the actions layer. Select the first keyframe of the actions layer and open up the Actions panel by pressing Option+F9 on the Mac or F9 on the PC. Lines 1 and 2 are that code that you wrote in the last movie and then we have an event listener added to remove button and then a skeleton of the removeBoard function is going to run when you click on the remove button.
So the board's already is on the stage. All we need to do is take it off when you click this button and you can probably guess how that would work. If you use addChild to add the board as a child, we would use removeChild to remove the board as a child. That's exactly how it works. So just type inside of that function, removeChild with capital C, open parenthesis, board, closed parenthesis. That's really all there is to it. So let's just test the movie by pressing Command+Return on the Mac or Ctrl+Enter on the PC and you can see that the board is on the stage, and when we click the Remove button, we use removeChild to take the board off the stage. It's fairly simple, huh? Well there is a look at how to use removeChild.
In the next few movies, we'll take a look at how to reference children in different ways.
There are currently no FAQs about ActionScript 3.0 in Flash CS3 Professional Beyond the Basics.
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.