adobe flash cs6 13 - cengage · flash 13-2 introduction completion of an eff ective adobe flash...
TRANSCRIPT
A D O B E F L A S H C S 6
1. Use Components in a Flash application
2. Use Components in a form
WORKING WITH COMPONENTS13CHAPTER
FLSH_CS6_003_ch13_rev01.indd 1FLSH_CS6_003_ch13_rev01.indd 1 31/07/12 5:46 PM31/07/12 5:46 PM
FLASH 13-2
Introduction
Completion of an eff ective Adobe Flash application depends on several factors, including the nature of the application (straightforward versus complex), the allotted development time, and the developer’s expertise. Components are a time-saving Flash feature that enables developers to speed up the development process and create eff ective applications without writing ActionScript code. Th ere are three categories of Components:
■ User Interface (UI)—Components (such as buttons and menus) that are used to create the visual interface for a Flash application.
■ Video—Components used to insert an FLV video fi le into a Flash document and allow the user to control the playback of the video including start, stop, and mute controls. You used the video FLVPlayback Component in Chapter 11.
■ Flex—Contains the FlexComponentBase class that is used to develop and deploy cross-platform applications.
Components are commonly used for creating check boxes, drop-down menus, and forms with boxes for entering user data, such as name and address. You can quickly add functionality to a Flash application by dragging and dropping Components (predeveloped movie clips) from the Components panel to the Stage.
You are not required to enter ActionScript code when using Components. However, you can use ActionScript to enhance the functionality of a Component. When you select a Component to use, it is placed in the Library panel for reuse in another part of the application.
In addition to the Components provided in Flash, you can obtain other Components from third-party companies and individuals. Oft en these are mini-applications, such as calendars, photo galleries, and preloaders, that add functionality to a Flash application.
13CHAPTER WORKING WITH COMPONENTS
FLSH_CS6_003_ch13_rev01.indd 2FLSH_CS6_003_ch13_rev01.indd 2 31/07/12 5:46 PM31/07/12 5:46 PM
TOOLS YOU’LL USE
FLASH 13-3
FLSH_CS6_003_ch13_rev01.indd 3FLSH_CS6_003_ch13_rev01.indd 3 31/07/12 5:46 PM31/07/12 5:46 PM
FLASH 13-4 Working with Components
In this lesson, you will learn how to use Components
to load external graphics and animations.
Use Components IN A FLASH APPLICATION
Using Components
Figure 1 shows the Components panel and the list of available User Interface Components displayed. Each Component name and icon provides a clue to its type, such as Button, CheckBox, and ScrollPane. Many of the User Interface Components are used as part of forms that can gather data from a user. Some, such as the UILoader Component, are used to display content. Th e UILoader Component can load external JPG graphic fi les and SWF application fi les. Th e fi les do not have to be in the Library panel or on the Stage in the original application. Instead, they can be loaded from a folder, using either a relative path or an absolute path, when the application is running. Th is can reduce the size of the movie and allow for easy updating of website content by simply changing the JPG or SWF fi les on the external site. You learned to load external fi les using ActionScript in a previous chapter. You can also use the UILoader to accomplish this same task.
L E S S O N 1
What You’ll Do Figure 1 Components panel showing the User
Interface Components
FLSH_CS6_003_ch13_rev01.indd 4FLSH_CS6_003_ch13_rev01.indd 4 31/07/12 5:46 PM31/07/12 5:46 PM
Lesson 1 Use Components in a Flash Application FLASH 13-5
Figure 2 The completed Component parameters to load a JPG image
Depending on the type of Component used, you will need to specify one or more of the following parameters:
■ source: Th is parameter is used to specify the location (server, directory, folder, and so on) for the content that is to be displayed using the Component. For example, when using the UILoader Component, if the JPG fi le is not located in the same folder as the movie fi le, a path to the JPG fi le needs to be specifi ed.
■ scaleContent: Th is parameter can be active (checked) or not active (not checked). If it is active, the content will automatically resize (reduce or enlarge but not crop) to the size of the Component. For example, a UILoader Component has a default size of 100 px by 100 px. If an object with dimensions of 50 px by 50 px is loaded and the scaleContent parameter is active, the object will expand to the larger size of the UILoader Component. If it is not active, the UILoader Component will be scaled to the smaller size associated with the object. Th e opposite is true as well. Th at is, if an object with dimensions of 200 px by 200 px is loaded and the scaleContent parameter is active, the
object will be scaled to fi t the smaller size of the UILoader Component. If the scaleContent parameter is not active, the UILoader Component will expand to be the larger size associated the object.
■ autoLoad: Th is parameter can be active (checked) or not active (not checked). If it is active, the Component will automatically display the specifi ed contents. If it is not active, the contents will not be displayed until some other action you specify, such as a button click, occurs.
■ label: Th is parameter allows you to type a text label. For example, you could type Contact Us as the text label for a button Component. Th e text label appears on the button graphic.
To use a Component, you fi rst select the frame and layer where the Component will be placed, then drag the Component from the Components panel to the desired location on the Stage. To complete the process, you use the Properties panel to set the Component parameters. Th e parameters available in the Component Parameters panel depend on which Component is selected. Figure 2 shows the Component parameters for a UILoader Component that is used to display the rosario.jpg image. Note: Th e label parameter is not listed because this UILoader Component is used for loading an image. Th e Label parameter is available in the Component Parameters panel when the Button Component is selected.
FLSH_CS6_003_ch13_rev01.indd 5FLSH_CS6_003_ch13_rev01.indd 5 31/07/12 5:46 PM31/07/12 5:46 PM
FLASH 13-6 Working with Components
Set up the workspace
1. Open fl 13_1.fl a from the drive and folder
where your Data Files are stored, then save it
as mySamples.fl a.
The Stage size is set to width: 800 px and
height 600 px.
2. Change the view to Fit in Window.
3. Click Control on the menu bar, point to Test Movie, then click in Flash Professional.
4. Click each of the navigation text buttons at
the bottom of the screen.
This is a basic website with simple screen
headings. There is no content on the screens
except for the Feedback form, which has several
text items such as Sex, Age, and Comments, but
the Components associated with the text items
have not been created yet.
5. Close the Flash Player window.
6. Click Window on the menu bar, then
click Components.
7. Dock the Components panel with the
Library panel and the Properties panel, as
shown in Figure 3.
8. Close the Code Snippet panel set if it is open.
9. View the Timeline and notice there is a layer
for each screen associated with a link in the
navigation bar at the bottom of each screen,
such as photos, animations, and feedback.
10. Drag the playhead to view each frame from
frame 1 to 4 and notice how the Stage changes.
You confi gured the workspace by displaying and arranging
panels and setting the magnifi cation. You then viewed each
frame of the movie.
Figure 3 Docking the Components panel
Components
panel grouped
with the Library
and Properties
panels
Note: The Components panel may be grouped with other panels. If so, drag the Components panel tab so it is
on top of the tab of the Library panel and, when a blue rectangle appears, release the panel to dock it. Then,
close the other panels.
FLSH_CS6_003_ch13_rev01.indd 6FLSH_CS6_003_ch13_rev01.indd 6 31/07/12 5:46 PM31/07/12 5:46 PM
Lesson 1 Use Components in a Flash Application FLASH 13-7
Use Components to load graphics
1. Click frame 2 on the photos layer.
2. Display the Components panel, click the User Interface expand icon , drag the UILoader Component from the Components panel to
the left side of the Stage, then release the
mouse button.
The UILoader Component appears on the Stage,
as shown in Figure 4.
3. Verify the UILoader Component is selected on the
Stage, click the Properties panel, then display
the COMPONENT PARAMETERS area.
TIP Throughout this chapter, you will be using both the
Components panel and the Properties panel. Click the
tab to activate the panel you need.
4. Be sure the rosario.jpg fi le is in the same folder as
the mySamples.fl a fi le.
Note: If rosario.jpg is not, the complete path to
the rosario.jpg fi le needs to be specifi ed.
5. Click the source text box in the Value column
in the COMPONENT PARAMETERS area, type
rosario.jpg, then press [Enter] (Win) or
[return] (Mac).
6. Verify that autoLoad and scaleContent have check
marks to indicate they are active.
Figure 4 Positioning the UILoader Component
UILoader Component on the
Stage; UILoader Component
default size 100 px by 100 px
(continued)
FLSH_CS6_003_ch13_rev01.indd 7FLSH_CS6_003_ch13_rev01.indd 7 31/07/12 5:46 PM31/07/12 5:46 PM
FLASH 13-8 Working with Components
7. Test the movie, then click Photos.
Notice the display size of the image, which
is determined by the size of the UILoader
Component. Because scaleContent is active, the
image was resized to the size of the UILoader.
8. Close the Flash Player window.
9. Uncheck the scaleContent check box so that
scaleContent is no longer active, as shown
in Figure 5.
10. Test the movie, then click Photos.
Notice the displayed image is larger. This is because
the UILoader has increased to the size of the image.
11. Close the Flash Player window.
Note: Be careful when using the scaleContent
parameter and resizing the UILoader. The
dimensions of the image should be taken
into account. If you have a small image that
is enlarged to fi t the UILoader dimension, the
image may lose clarity as the pixels increase.
You placed the UILoader Component on the Stage and specifi ed
the graphic to be loaded. You also changed the parameters to
have the Component scale to the size of the graphic.
Figure 5 Unchecking the scaleContent option
Properties
for UILoader
scaleContent option
not selected
Your settings might diff er
FLSH_CS6_003_ch13_rev01.indd 8FLSH_CS6_003_ch13_rev01.indd 8 31/07/12 5:46 PM31/07/12 5:46 PM
Lesson 1 Use Components in a Flash Application FLASH 13-9
Use Components to load text
1. Display the Components panel, then drag the
TextArea Component to the Stage and position
it to the right of the UILoader and under the
ending “s ” in Photos.
2. Display the Properties panel, display the POSITION
AND SIZE area, be sure the Lock Icon is broken,
then set the TextArea Component width to 300 and
the height to 60.
3. Uncheck the editable parameter in the
COMPONENT PARAMETERS area of the Properties
panel, then verify the wordWrap parameter
is active.
4. Use your fi le management program to navigate
to the drive and folder where your Data Files are
stored, then double-click rosario.txt to open the
fi le in a text editor, as shown in Figure 6.
TIP If the text appears on one long line in Notepad, click
Format on the menu bar, then click Word Wrap.
Figure 6 The rosario.txt fi le in a text editor
(continued)
FLSH_CS6_003_ch13_rev01.indd 9FLSH_CS6_003_ch13_rev01.indd 9 31/07/12 5:46 PM31/07/12 5:46 PM
FLASH 13-10 Working with Components
Figure 8 Setting animation.swf as the source fi le
UILoader will
play this SWF fi le,
animation.swf
5. Use the text editor menu commands (usually
available via the Edit menu) to select all the
text, use the text editor menu to copy all the
text, then close the text editor window.
6. Return to the Flash document, click in the text text box in the COMPONENT PARAMETERS area
of the Properties panel, press and hold [Ctrl],
press [V] (Win) or [command]+V (Mac), then
press [Enter] (Win) or [return] (Mac) to paste
the text into the text box, as shown in Figure 7.
7. Test the movie.
8. Click Photos, then scroll to read all the text in
the text box.
Note: If the text box overlaps the photo, you can
adjust the position of either object when you
return to the Flash workspace.
9. Close the Flash Player window, then save your work.
You used the TextArea Component to display text by copying the
text to the text text box in the Properties panel.
Use Components to load an animation (SWF fi le)
1. Click frame 3 on the animation layer.
2. Display the Components panel, then drag the
UILoader Component from the Components
panel to the Stage and position it on the Stage
below and to the left of the heading Animation.
3. Display the Properties panel, then verify autoLoad
and scaleContent have check marks.
4. Be sure the animation.swf fi le is in the same
folder as the mySamples.fl a fi le.
Note: If animation.swf fi le is not, the complete path
to the animation.swf fi le needs to be specifi ed.
(continued)
Figure 7 The rosario text pasted into the text text box
Be sure Lock icon
is broken
Dimensions
for TextArea
Component
Text placed in TextArea
Component based on text
entered in text text box
FLSH_CS6_003_ch13_rev01.indd 10FLSH_CS6_003_ch13_rev01.indd 10 31/07/12 5:46 PM31/07/12 5:46 PM
Lesson 1 Use Components in a Flash Application FLASH 13-11
5. Click in the source text box, type animation.swf
as shown in Figure 8, then press [Enter] (Win) or
[return] (Mac).
6. Test the movie, then click Animations.
Notice the size of the stick fi gure. Because the
scaleContent parameter is active, the size of
the animation is determined by the size of
the UILoader. See the top of Figure 9.
7. Close the Flash Player window, then uncheck
the scaleContent check box.
8. Test the movie, then click Animations.
The UILoader is resized to the size of the
animation.swf movie clip. See the bottom
of Figure 9.
9. Close the Flash Player window.
10. Save your work.
You used a UILoader Component to display an SWF fi le by
specifying the contentPath and scaleContent parameters.
Figure 9 Comparing the eff ect of using the scaleContent option
scaleContent option active
scaleContent option not active
FLSH_CS6_003_ch13_rev01.indd 11FLSH_CS6_003_ch13_rev01.indd 11 31/07/12 5:46 PM31/07/12 5:46 PM
FLASH 13-12 Working with Components
What You’ll Do Creating a Form with Components
Flash provides several Components that can be used to create forms, such as a survey or registration form, for a website or an application. Table 1 lists the most commonly used Components for forms. Th e process for developing a form is to plan out the form
Use Components IN A FORM
In this lesson, you will place Components in a form and
then set properties specifi c to those Components.
including each Component to be used and its location, then drag each Component to the Stage and position it as desired. Once a Component is placed and while it is selected, you use the Properties panel to change its properties, such as the size, and to specify other properties, such as labels and values.
L E S S O N 2
Table 1 Common Components used in forms
FLSH_CS6_003_ch13_rev01.indd 12FLSH_CS6_003_ch13_rev01.indd 12 31/07/12 5:46 PM31/07/12 5:46 PM
Lesson 2 Use Components in a Form FLASH 13-13
Figure 10 The completed form showing the position of the Components Use Components to create a form
1. Click frame 4 on the feedback layer, then click a
blank area of the Stage to deselect the objects.
Figure 10 shows the form with the position of
the Components.
2. Display the Components panel, then drag the
RadioButton Component to the Stage and
position it next to Sex. (Hint: Use the arrow
keys on the keyboard to adjust the position of
the Component.)
3. Display the Properties panel, then change the
label in the label text box in the COMPONENT
PARAMETERS area to F.
4. Repeat Steps 2 and 3 to add a second
RadioButton with the label set to M.
5. Display the Components panel, then drag the
ComboBox Component to the Stage and
position it next to Age.
A ComboBox allows you to enter values that
appear when the user clicks the list button so
that the user can select a value from the list.
6. Display the Properties panel, then click next
to dataProvider in the Value column.
The Values dialog box opens.
(continued)
FLSH_CS6_003_ch13_rev01.indd 13FLSH_CS6_003_ch13_rev01.indd 13 31/07/12 5:46 PM31/07/12 5:46 PM
FLASH 13-14 Working with Components
7. Click the Add value button , click label0 in
the Value column, then type under 20.
8. Click the Add value button , click label0 in
the Value column, then type 21 – 40.
9. Click the Add value button , click label0 in
the Value column, then type 41 – 60.
10. Click the Add value button , click label0,
type over 60, then press [Enter] (Win) or
[return] (Mac).
Your Values dialog box should resemble Figure 11.
11. Click OK.
12. Display the Components panel, then drag the
CheckBox Component to the Stage and
position it below “How did you hear about
my site?”
13. Display the Properties panel, then change the
label in the label text box in the COMPONENT
PARAMETERS area to Search.
14. Repeat Steps 12 and 13 to add three more
check boxes for Surfi ng, Friend, and Other—please specify.
15. Click Other—please specify, verify the lock
icon in the POSITION AND SIZE area is broken
, then use the Properties panel to change
the width to 150.
(continued)
Figure 11 The completed Values dialog box
Text typed
in the Value
column appears
automatically in
the Name column
Value column
Typed text
replaces label0
Drag the scroll bar up
to see under 20 value
Add value button
FLSH_CS6_003_ch13_rev01.indd 14FLSH_CS6_003_ch13_rev01.indd 14 31/07/12 5:46 PM31/07/12 5:46 PM
16. Display the Components panel, then drag the
TextInput Component to the Stage and
position it below the Other—please specify
check box.
17. Display the Properties panel, then verify
editable is active.
18. Type 20 for the maxChars.
19. Display the Components panel, then drag the
TextInput Component to the Stage and
position it next to Comments.
20. Verify the TextInput Component next to
Comments is selected on the Stage, display the
Properties panel, then change the width to 200,
as shown in Figure 12.
21. Use the arrow keys to adjust the placement
of the Component as needed, then click the
Pasteboard to deselect the Component.
22. Test the movie, click Feedback, then fi ll in
the form.
Notice that you can only select one radio button,
and you can only select one option from the list
in the combo box. You can select as many check
boxes as you want, and you can type freely in
the Comments text input box. As you type in the
Comments input box, the text scrolls horizontally
to allow additional text. You are limited to
20 characters in the Other—please specify input
box. Note: The Send button is not active.
23. Close the Flash Player window, save your work,
then close the document.
You used Components to create a form.
Figure 12 Changing the width of the TextInput Component
Be sure the Lock
icon is broken
Type width here
Lesson 2 Use Components in a Form FLASH 13-15
FLSH_CS6_003_ch13_rev01.indd 15FLSH_CS6_003_ch13_rev01.indd 15 31/07/12 5:46 PM31/07/12 5:46 PM
FLASH 13-16 Working with Components
S K I L L S R E V I E W
3. Drag four CheckBox Components to the right of the
Areas of Interest question and label them: Arts/Hum; Business; Science; and Soc Science.
4. Drag the CheckBox Component to below the Arts/Hum
check box and label it: Other (specify).
5. Change the width of the check box to 112.
6. Drag the TextInput Component to the right of the
Other (specify) check box and set the maximum
characters to 40.
7. Drag the ComboBox to the right of Highest
degree earned.
8. Click the brackets for the dataProvider Property
in the COMPONENT PARAMETERS area of the
Properties panel.
9. Use the Values dialog box to add the following
labels: none, High School, Associate, Bachelors,
Masters, Doctorate.
10. Drag Text Input Components to the right of First
Name and Last Name.
11. Test the movie, click the A Form arrow button,
compare your screens to Figure 13 on the next page,
then test each Component. Note: The Submit button is
not active.
12. Close the Flash Player window, save your work, then
close the document.
Set up the workspace.
1. Start Flash, open fl 13_2.fl a, then save it
as skillsDemo13.fl a.
2. Test the movie and click the buttons.
3. Close the Flash Player window.
4. Open the Components panel if it is not already open,
then dock the Component panel with the Library and
Properties panels if they are not already grouped.
Use Components to load graphics.
1. Select frame 2 on the loading graphics and text layer.
2. Drag the UILoader Component to the left side of
the Stage.
3. Set the width to 200 and the height to 200 in the
POSITION AND SIZE area of the Properties panel.
4. Click the source text box in the COMPONENT
PARAMETERS area of the Properties panel, type
kayaking.jpg, then press [Enter] (Win) or
[return] (Mac).
5. Verify that autoLoad and scaleContent are active.
6. Verify that the kayaking.jpg fi le is in the same folder
as the skillsDemo13.fl a fi le.
7. Save your work.
Use Components to load text.
1. Drag the TextArea Component to the Stage and
position it to the right of the UILoader.
2. Verify editable and wordWrap are active.
3. Change the width to 250 and the height to 100.
4. Use your fi le management program to navigate to
the drive and folder where your Data Files are stored,
then open the fi le kayaking.txt in a text editor.
5. Select and copy the text in the kayaking.txt fi le, close
the text editor, then paste the text into the text text
box in the COMPONENT PARAMETERS area in Properties
panel and press [Enter] (Win) or [return] (Mac).
6. Test the movie, then click the arrow button for
Loading graphics and text.
7. Use the scroll bar to read the text, as needed.
8. When done, close the Flash Player window, then save
your work.
Use Components to load an animation.
1. Select frame 3 on the loading animations layer.
2. Drag the UILoader Component to the left edge of the
Stage beneath the heading.
3. Use the Properties panel to verify autoLoad is active,
then uncheck the scaleContent check box to make
scaleContent not active.
4. Type kayaker.swf for the source, then press [Enter]
(Win) or [return] (Mac).
5. Test the movie and click the Loading animations
arrow button to view the animation.
6. When done, close the Flash Player window.
7. Save your work.
Use Components to create a form.
1. Select frame 4 on the “a form” layer, then click the
Pasteboard to deselect the objects on the Stage.
2. Drag three RadioButton Components to the right of
the fi nancial aid question and label them Yes, No,
and Not sure.
FLSH_CS6_003_ch13_rev01.indd 16FLSH_CS6_003_ch13_rev01.indd 16 31/07/12 5:46 PM31/07/12 5:46 PM
Working with Components FLASH 13-17
S K I L L S R E V I E W C O N T I N U E D
Figure 13 Completed Skills Review—Adding Components
FLSH_CS6_003_ch13_rev01.indd 17FLSH_CS6_003_ch13_rev01.indd 17 31/07/12 5:46 PM31/07/12 5:46 PM
FLASH 13-18 Working with Components
P R O J E C T B U I L D E R 1
9. Have the UILoader Component load the kapalua.jpg
fi le as the source fi le. (Note: Be sure this fi le is stored in
the same folder as your ultimateTours 13 application.)
10. Add the TextArea Component below the graphic
UILoader Component and change the width to
200 pixels and height to 60 pixels.
11. Set the X coordinate value to 175 and the Y value
to 320.
12. Use your fi le management program to open
kapalua.txt in a text editor, then copy the text to the
text text box in the COMPONENTS PARAMETER area of
the Properties panel.
13. Click frame 2 on the actions layer, insert a keyframe,
then use the Actions panel to add a stop(); action.
14. Test the movie in either Air Debug Launcher, click
the question mark (?) button, then compare it to the
sample images shown in Figure 14.
15. Close the window in which you previewed the
application, save your work, then close the document.
3. Click 1 on the Timeline, select the button with
the question mark (?), give it an instance name of
questionBtn, then use the Code Snippets panel to
add an event listener that will call a function to cause
the playhead to jump to frame 2 when the button
is clicked.
4. Add the UILoader Component to the top of the
destination page and change the width to 550 pixels
and the height to 50 pixels.
5. Set the X coordinate value to 0 and the Y value to 30.
6. Have the UILoader Component load destination.swf
as the source fi le with the scaleContent option not
active. (Note: Be sure this fi le is stored in the same
folder as your ultimateTours13 application.)
7. Add the UILoader Component to the middle of the
destination page and change the width and height
to 200 pixels.
8. Set the X coordinate value to 175 and the Y value
to 100.
Th e Ultimate Tours travel company wants to promote a special destination that changes periodically. Th ey have asked you to design an application that could be used on a mobile device or desktop computer. Th e application is to contain an animated heading, photo of the site, and short description. Th e application is to link to the home page. You decide to create the application using Components so that the company can easily update the photo, description, and sound. Figure 14 shows the link on the home page, the destination page UILoader Components for the animated heading and photo, and a TextArea Component for the description.
1. Open fl 13_3.fl a, then save it as ultimateTours13.fl a.
(Hint: If the font used in this fi le is not available on
your computer, you can choose to use a default font
or substitute another font.)
2. Insert a new layer above the Destination_btn layer,
name it Destination page, then add a keyframe to
frame 2 on that layer.
FLSH_CS6_003_ch13_rev01.indd 18FLSH_CS6_003_ch13_rev01.indd 18 31/07/12 5:46 PM31/07/12 5:46 PM
Working with Components FLASH 13-19
P R O J E C T B U I L D E R 1
Figure 14 Sample completed Project Builder 1
C O N T I N U E D
FLSH_CS6_003_ch13_rev01.indd 19FLSH_CS6_003_ch13_rev01.indd 19 31/07/12 5:46 PM31/07/12 5:46 PM
FLASH 13-20 Working with Components
Th e International Student Association (ISA) is interested in obtaining information that could be used to determine the eff ectiveness of its website and improve the site contents. Management would like to add a page with a survey form to its website and has asked you to develop two sample forms. Aft er reviewing the forms, management will select one to be linked to the ISA home page. Th e intent is to keep the survey short so that site visitors are encouraged to complete and submit it. Figure 15 shows a sample form. Using Figure 15 as a guide, create this introductory survey form.
1. Create a new Flash document, then save it as
isa_survey13.
2. Change the Stage color.
3. Place the following on separate layers:
■ a border
■ the ISA heading
■ the text for the form
■ radio buttons for the ratings with appropriate labels
■ comboBox for the times visited with appropriate
choices
■ check boxes for the sections visited with appropriate
labels
■ TextInput box for the comments
■ button Component
Make sure the parameters of the Components have
the appropriate settings, such as editable for the
TextInput Component.
P R O J E C T B U I L D E R 2
4. Test the movie, then close the Flash Player window.
5. Publish the movie and display it in a browser.
6. Close your browser.
7. Save your work, then close the document.
Figure 15 Samle completed Project Builder 2
FLSH_CS6_003_ch13_rev01.indd 20FLSH_CS6_003_ch13_rev01.indd 20 31/07/12 5:46 PM31/07/12 5:46 PM
Working with Components FLASH 13-21
D E S I G N P R O J E C T
Figure 16 shows part of a form displayed on a website. Aft er connecting to the website, scroll the page to view the entire form and complete the following questions. For each question, indicate how you determined your answer.
1. Connect to the Internet, then go to
http://www.nleb.org/SL_tissue_request.cfm.
2. Open a document in a word processor or create a
new document in Flash, save the fi le as dpc13,
then answer the following questions.
■ Whose website is this?
■ What is the goal of the site? (Note: Click on the SightLife
logo in the upper left of the screen to display the home
page to answer this question.)
■ Who is the target audience?
■ How might Components be used in this site? (Note:
Return to the Tissue Request Form page or refer to
Figure 16 to answer this question.)
■ What other types of forms might the site developers
create?
Figure 16 Design Project© 2010 SightLife™. http://www.nleb.org/SL_tissue_request.cfm
FLSH_CS6_003_ch13_rev01.indd 21FLSH_CS6_003_ch13_rev01.indd 21 31/07/12 5:46 PM31/07/12 5:46 PM
FLASH 13-22 Working with Components
You have been asked by a local artist to help design the gallery page for her website. Th e page will include samples of her artwork and will be linked to her home page. Th e gallery page could be used to showcase her work as an online portfolio. Figure 17 shows the home page and a sample gallery page.
1. Open fl 13_4.fl a, then save it as gallery.fl a.
2. Select the Gallery button, give it an instance name of
galleryBtn, select frame 1 of the actions layer, then
use the Actions panel to enter the ActionScript code
that adds an event listener with a function to display
frame 2 when the button is clicked.
3. Use the following steps to create the Gallery page.
Use frame 2 for the Gallery page. Add layers as
indicated and name them appropriately.
■ Extend the background, border, and copyright layers
to frame 2.
P O R T F O L I O P R O J E C T
■ Insert a new layer, name it gallery heading, add a
keyframe in frame 2, then type the Gallery heading.
■ Insert a new layer above the gallery heading layer,
name it paintings, add a keyframe in frame 2, then
use UILoader Components to have the six paintings
appear on the Gallery page. Set the scaleContent
parameter so that the UILoader scales to the size of
the JPG fi le. (Note: Use the captions on the images
in Figure 17, as well as the fi lenames as seen in
your fi le management program, to know which JPG
image to associate with which ULLoader.)
■ Insert a new layer above the paintings layer, name
it captions, add a keyframe to frame 2, then use
TextArea Components to have the six painting
captions appear on the Gallery page, as shown in
Figure 17. Set the width of each TextArea Component
to 150 and the height to 24.
■ Insert a new layer above the captions layer, name
it home button, insert a keyframe in frame 2,
then create a Home button with an instance name
of homeBtn.
■ Insert a keyframe in frame 2 of the actions layer,
then use the Actions panel to add a stop(); action
and the ActionScript that adds an event listener with
a function to display frame 1 when the Home text
button is clicked.
4. Verify that all of the JPG fi les are in the same folder as
the gallery.fl a fi le.
5. Test the movie and test the Gallery and
Home buttons.
6. Close the Flash Player window.
7. Publish the movie and display it in a browser.
8. Close the browser window, save your work, then
close the document.
FLSH_CS6_003_ch13_rev01.indd 22FLSH_CS6_003_ch13_rev01.indd 22 31/07/12 5:46 PM31/07/12 5:46 PM
Working with Components FLASH 13-23
P O R T F O L I O P R O J E C T C O N T I N U E D
Figure 17 Sample completed Portfolio Project
Paintings courtesy of Barbara VanDyke Shuman
FLSH_CS6_003_ch13_rev01.indd 23FLSH_CS6_003_ch13_rev01.indd 23 31/07/12 5:46 PM31/07/12 5:46 PM
FLSH_CS6_003_ch13_rev01.indd 24FLSH_CS6_003_ch13_rev01.indd 24 31/07/12 5:46 PM31/07/12 5:46 PM