1 Step RoboPDF, ActiveEdit, ActiveTest, Authorware, Blue Sky Software, Blue Sky, Breeze, Breezo, Captivate, Central,
ColdFusion, Contribute, Database Explorer, Director, Dreamweaver, Fireworks, Flash, FlashCast, FlashHelp, Flash Lite,
FlashPaper, Flash Video Encoder, Flex, Flex Builder, Fontographer, FreeHand, Generator, HomeSite, JRun, MacRecorder,
Macromedia, MXML, RoboEngine, RoboHelp, RoboInfo, RoboPDF, Roundtrip, Roundtrip HTML, Shockwave, SoundEdit,
Studio MX, UltraDev, and WebHelp are either registered trademarks or trademarks of Macromedia, Inc. and may be registered in
the United States or in other jurisdictions including internationally. Other product names, logos, designs, titles, words, or phrases
mentioned within this publication may be trademarks, service marks, or trade names of Macromedia, Inc. or other entities and
may be registered in certain jurisdictions including internationally.
Third-Party Information
This guide contains links to third-party websites that are not under the control of Macromedia, and Macromedia is not
responsible for the content on any linked site. If you access a third-party website mentioned in this guide, then you do so at your
own risk. Macromedia provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia
endorses or accepts any responsibility for the content on those third-party sites.
Speech compression and decompression technology licensed from Nellymoser, Inc. (www.nellymoser.com).
Sorenson™ Spark™ video compression and decompression technology licensed from
Sorenson Media, Inc.
Editing: Evelyn Eldridge, Mark Nigara, Lisa Stanziano, Anne Szabla
Production Management: Patrice O’Neill, Kristin Conradi, Yuko Yagi
Media Design and Production: Adam Barnett, Aaron Begley, Paul Benkman. John Francis, Geeta Karmarkar, Masayo Noda,
Paul Rangel, Arena Reed, Mario Reynoso
Special thanks to Jody Bleyle, Mary Burger, Lisa Friendly, Stephanie Gowin, Bonnie Loo, Mary Ann Walsh, Erick Vera, the beta
testers, and the entire Flash and Flash Player engineering and QA teams.
Macromedia Flash Basic 8 and Macromedia Flash Professional 8 provide
everything you need to create and deliver rich web content and powerful
applications. Whether you’re designing motion graphics or building datadriven applications, Flash has the tools necessary to produce great results
and deliver the best user experience across multiple platforms and devices.
The samples in this book are designed to introduce you to Flash. As you
explore the samples, you will see many of the basic techniques used in
creating Flash applications.
For additional samples see www.macromedia.com/go/flash_samples.
NOTE
This book is not a comprehensive manual that details all of the features of
Flash. For in-depth information about how to use Flash, see Using Flash
and Learning ActionScript 2.0 in Flash.
5
6Introduction
CHAPTER 1
Graphics
Graphics samples are provided when you install Macromedia Flash 8. This
chapter contains a brief overview of each sample.
This sample shows how to create a realistic-looking animated drop shadow
by layering two instances of the same movie clip and adding a drop shadow
filter to the lower layer.
To re-create the process of constructing this sample, you first create the
shadow effect for the dog by nesting the animation inside a movie clip. You
then duplicate the movie clip instance and place it behind the original
instance. (You can keep the duplicate on the same layer and arrange it
behind the original instance, or paste it to a new layer below the original.)
You then select the duplicate instance and, in the Filters tab of the Property
inspector, select Drop Shadow from the Plus (+) menu.
Next, adjust the strength level to around 45% and select Hide Object. This
hides the movie clip object but reveals the drop shadow filter properties.
You can make further adjustments by setting Quality to Low, Medium, or
High, or modifying the amount of blur, the color, the angle, or the distance
of the blur effect from the original graphic.
1
7
To prevent this effect from looking too much like a drop shadow against a
flat wall behind the original object, you can use the Free Transform tool to
skew the filtered movie clip instance. This technique takes a bit of trial and
error. Squash and skew the instance until it looks as if the shadow is being
cast upon a floor. (You may need to reposition the instance.) Test the movie
clip, and you see the effect come to life.
You can find the sample source files, drop_shadow_dog.fla and
drop_shadow_monkey.fla, in the Samples folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\Graphics\AnimatedDropShadow.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/Graphics/
AnimatedDropShadow.
These samples were developed by Chris Georgenes.
Animation and gradients
This sample shows how to create a realistic-looking animation with
gradients and drop shadows.
To re-create the process of constructing this sample, you first design the
eight-ball graphic. Start by mixing a radial gradient containing three colors:
black, white, and a medium gray. Then create a circle with the Oval tool
(hold down Shift to constrain the shape so it is perfectly round), and fill it
with the new radial gradient. Using the Gradient Transform tool, edit the
radial gradient fill by offsetting it from the center of the circle. This gives
the illusion of depth as the off-center white highlight gradually changes to
black and a subtle amount of gray appears in the lower-right corner of the
sphere. This is crucial for making a convincing-looking sphere; it suggests
light wrapping around from behind the ball.
Then convert the gradient fill to a graphic symbol and edit it further by
adding a new layer and applying a shadow using a linear gradient. The
linear gradient uses two colors with varying amounts of alpha mixed in.
8Graphics
The next step is to create a movie clip symbol and place this eight-ball
graphic inside it. Inside this movie clip is where the “8” graphic is added
along with a mask layer. Then add a mask that is the same size and shape as
the eight ball, and use the Free Transform tool and motion tweening to
create the illusion of the ball rolling in various directions by moving and
squashing the “8” graphic across the surface of the circle. The mask
constrains the visibility of the “8” graphic to the exact area of the circle
below it. This makes for a convincing illusion of the ball rolling.
Then add animations of the ball rolling to a stop and starting from a
stationary position. Use descriptive frame labels and simple frame actions
so this movie clip can be targeted later with ActionScript from the main
timeline. The movie clip has to be set up this way; it uses a drop shadow,
which can be applied only to movie clip instances.
Applying the drop shadow is the easiest part, thanks to the graphics filters
in Flash. You simply select the movie clip instance, and from the Filters tab
of the Property inspector, click the Plus (+) pop-up menu and select Drop
Shadow. From there you can adjust the amount of blur, strength, quality,
color, angle distance, and so on.
The drop shadow filter is used to create blurs only when the eight ball is
animated moving rapidly across the screen. This emphasizes the speed at
which the ball is moving and creates a dynamic visual effect.
You can find the sample source file, animation_and_gradients.fla, in the
Samples folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\Graphics\AnimationAndGradients.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/Graphics/
AnimationAndGradients.
This sample was developed by Chris Georgenes.
Animation and gradients9
10 Graphics
CHAPTER 2
Accessibility
An accessibility sample is provided when you install Macromedia Flash 8.
This chapter contains a brief overview of this sample.
This sample shows how to use accessibility features such as tab ordering,
components, and the Accessibility panel. In this sample, you can see how
to use the new authoring tool features and user interface, which are geared
toward building applications that contain the accessibility features. An
arrow moves to indicate which element on the Stage has the focus. Explore
the source code to learn more about how to take advantage of the Flash
accessibility features.
You can find the sample source file, AccessibleApplications.fla, in the
Samples folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\Accessibility\AccessibleApplications.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/Accessibility/
AccessibleApplications.
2
11
12 Accessibility
CHAPTER 3
Masking
Masking samples are provided when you install Macromedia Flash 8. This
chapter contains a brief overview of each sample.
This sample explores Flash Player support for masking device fonts. The
main features illustrated in the sample are device font masking,
components, and scriptable masks. Newly added support in Flash Player
for masking device fonts expands the possibilities for using scriptable
masks on Flash content. Device font masking allows device fonts to be
used inside components that mask their content, as well as custom masks
that you create. This sample shows examples of both types of masking.
You can find the sample source file, DeviceFontMasking.fla, in the Samples
folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\Masking\DeviceFontMasking.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/Masking/
DeviceFontMasking.
3
13
Scriptable masks
This sample shows how to dynamically mask Flash content at runtime
using scriptable masks and components. Scriptable masking allows precise
control over how masks behave at runtime, and allows the mask and the
masked content to be dynamically changed at runtime. This sample shows
different types of masks and masked content that are controlled by a user
interface built with components. Explore this sample to learn more about
masking and building interfaces with components.
You can find the sample source file, ScriptableMasksPart2.fla, in the
Samples folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\Masking\ScriptableMasksPart2.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/Masking/
ScriptableMasksPart2.
14 Masking
CHAPTER 4
Text
Text samples are provided when you install Macromedia Flash 8. This
chapter contains a brief overview of each sample.
This sample uses the many new text enhancements added to Macromedia
Flash Basic 8 and Macromedia Flash Professional 8. The features
highlighted in this sample are text styles, inline images, hyperlink
improvements, and small text optimization. The text enhancements
provide better and more precise control over text as it is entered in Flash
Player. This sample loads an external HTML file named sample.html into
a text field in the SWF file. However, you could use any text file that
incorporates a tag-based format such as XML or HTML. New support for
Cascading Style Sheets allows Flash to style the text in a given text field for
each tag before displaying it. This sample uses a style sheet named style.css.
Additionally, Flash Player supports the
your text wraps around.
You can find the sample source file, TextEnhancements.fla, in the Samples
folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\Text\TextEnhancements.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/Text/
TextEnhancements.
img tag, allowing inline images that
4
15
Multilingual content
This sample, featuring the Strings panel, shows a streamlined approach to
developing and managing content in several languages. The new Strings
panel provides for easy and fast content development in different
languages. Localized content for text fields inside the document is kept in
language-specific XML files in directories alongside the document. This
sample has content in several languages. The language displayed
corresponds to the current language of the host operating system. Explore
this sample to see how the Strings panel manages localized content.
You can find the sample source file, MultiLingualContent.fla, in the
Samples folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\Text\MultilingualContent.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/Text/
MultilingualContent.
16 Text
CHAPTER 5
Behaviors
A behaviors sample is provided when you install Macromedia Flash 8. This
chapter contains a brief overview of this sample.
This sample shows how to build an interactive photo scrapbook by using
behaviors instead of scripting. Behaviors provide an easy way to add
interactivity to your Flash content without having to write ActionScript. In
this sample, multiple behaviors are combined to create an interactive
scrapbook. Explore the source file to learn more, or customize it by adding
your own pictures.
You can find the sample source file, BehaviorsScrapbook.fla, in the Samples
folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\Behaviors\BehaviorsScrapbook.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/Behaviors/
BehaviorsScrapbook.
5
17
18 Behaviors
CHAPTER 6
Components
Several component samples are provided when you install Macromedia
Flash 8. This chapter contains a brief overview of each sample.
This sample is the starter file you can use in the tutorial “Creating an
Application with Components (Flash Professional Only)” in Using Components. The end result of the tutorial is a file identical to first_app.fla.
You can find this starter Flash (FLA) file, first_app_start.fla, and the
finished file, first_app.fla, in the Samples folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples
ComponentsApplication.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples
ComponentsApplication.
and Tutorials\Samples\Components\
and Tutorials/Samples/Components/
6
19
Dial component sample
This sample provides an example of a dial component with a getter/setter
property that gets or sets the position of the needle on the dial.
This sample is discussed in “Building your first component” in
Using Components.
You can find the sample source file, Dial.fla, in the Samples folder on your
hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\Components\DialComponent.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/Components/
DialComponent.
Login component sample
The sample LogIn component files are the completed files created in the
LogIn tutorial in Chapter 6, “Creating Components” in Using Components.
This sample LogIn component demonstrates how to incorporate the power
of Flash components into your own custom components using the version
2 Macromedia Component Architecture and ActionScript 2.0. This
sample demonstrates how to create a form that captures and validates data,
sends it to a server, and receives a response.
You can bring Flash components into your own components by importing
their uncompiled movie clip symbols from the library in
StandardComponents.fla.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
The LogIn sample component uses Button, Label, and InputField
component movie clip symbols to create a simple name and password login
interface that dispatches a click event when the Login button is clicked.
The sample includes a document file (.fla) containing the LogIn
component movie clip symbol in its library and the LogIn component’s
class ActionScript file (.as), which defines its class properties and methods.
Explore both files to learn about the basic version 2 component structure
and how to incorporate the capabilities of Flash components into your own
custom components.
You can find the sample source file, login.fla, in the Samples folder on your
hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\
Samples and Tutorials\Samples\Components\Login.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/Components/
Login.
Tip calculator
This sample demonstrates how to perform event handling with forms
and components.
You can find the sample source files (TipCalculator.fla, TipCalculator1.fla,
and TipCalculator2.fla) in the Samples folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\
Samples and Tutorials\Samples\Components\TipCalculator.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/Components/
TipCalculator.
Tip calculator 21
Components jukebox
This sample demonstrates how to create a jukebox by using data types,
general coding principles, and several components.
You can find the sample source file, jukebox.fla, in the Samples folder on
your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\Components\Jukebox.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/Components/
Jukebox.
22 Components
CHAPTER 7
ActionScript
Several ActionScript samples are provided when you install Macromedia
Flash 8. This chapter contains a brief overview of each sample.
In this sample, you can see how to add custom options to the Flash Player
context menu using ActionScript 2.0. This sample uses ActionScript to
modify the context menu by adding cut, copy, and paste functionality that
can be applied to the drawing objects on the Stage. The source includes the
document file (.fla) and the ActionScript file (.as) that defines the
ClipBoard class. Explore both files to learn more about the context menu
and writing classes with ActionScript 2.0.
You can find the sample source file, CustomizingContextMenu.fla, in the
Samples folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\
CustomizingContextMenu.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
CustomizingContextMenu.
Filters with ActionScript
This sample shows how to apply filter effects to images with ActionScript.
You can apply different filters to several images, and then manipulate their
properties at runtime. The ActionScript code shows how to apply filters
and manipulate the filter properties using components.
You can find the sample source file, Filters.fla, in the Samples folder on
your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\Filters.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
Filters.
24 ActionScript
Animation with ActionScript
This sample provides an example of programmatic animation using
ActionScript. It shows a simple game where instances are animated across
the Stage at runtime. You create a custom mouse pointer, and you can tally
scores by manipulating strings and using operators to write equations.
You can find the sample source file, animation.fla, in the Samples folder on
your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\Animation.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
Animation.
The Tween class, the
TransitionManager class, and
progress bars
This sample shows how to script animation using the Tween and
TransitionManager classes, which provide an easy way to animate instances
using code. It also shows how to create a progress bar using code.
You can find the sample source file, tweenProgress.fla, in the Samples
folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\Tween ProgressBar.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
Tween ProgressBar.
The Tween class, the TransitionManager class, and progress bars 25
ActionScript data types
This sample provides an example of converting data from one type
to another.
You can find the sample source file, datatypes.fla, in the Samples folder on
your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\DataTypes.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
DataTypes.
Bitmap caching with
ActionScript
This sample demonstrates the benefit of using bitmap caching when you
animate complex vector shapes. Click the button on the Stage to see the
vast improvement
You can find the sample source file, cacheBitmap.fla, in the Samples folder
on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\CacheBitmap.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
CacheBitmap.
cacheAsBitmap has on the animating movie clips.
26 ActionScript
Drawing with ActionScript
This sample demonstrates how to draw lines and create, fill, sort, and
remove shapes with ActionScript.
You can find the sample source file, drawingapi.fla, in the Samples folder
on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\DrawingAPI.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
DrawingAPI.
ActionScript arrays example
This sample illustrates array manipulation using ActionScript. The code in
the sample creates an array and sorts, adds, and removes items of two
List components.
You can find the sample source file, array.fla, in the Samples folder on your
hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\Arrays.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
Arrays.
ActionScript arrays example 27
Interaction between the browser
and Flash Player
This sample demonstrates how to use the External API (ExternalInterface
class) to create interaction between the browser and your SWF file. In this
sample, HTML form controls on a web page let you manipulate and
display information about an FLV video that plays in a SWF file. Messages
from the SWF file appear in an HTML text field.
You can find the sample source file, external.fla, in the Samples folder on
your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\ExternalAPI.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
ExternalAPI.
Stage size control with
ActionScript
This sample demonstrates how the Stage.scaleMode property affects
the values of
is resized.
You can find the sample source file, stagesize.fla, in the Samples folder on
your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\StageSize.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
StageSize.
Stage.width and Stage.height when the browser window
28 ActionScript
Text loading with ActionScript
This simple sample shows how to load text into a SWF file at runtime
using the LoadVars class.
You can find the sample source file, loadText.fla, in the Samples folder on
your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\LoadText.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
LoadText.
Formatted text with ActionScript
This sample shows how to load formatted text into a SWF file at runtime.
You can find the sample source file, formattedText.fla, in the Samples
folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\LoadText.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
LoadText.
FlashType sample
This sample shows how to apply and manipulate anti-aliased text in an
application. You use the FlashType rendering technology to create small
text that’s highly legible. This sample also demonstrates how text fields can
scroll quickly and smoothly when you use the
You can find the sample source file, flashtype.fla, in the Samples folder on
your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\FlashType.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
FlashType.
cacheAsBitmap property.
FlashType sample 29
Login sample
This sample shows how to add simple login functionality to your websites
using ActionScript 2.0. The sample uses ActionScript and components to
create a small form in which you enter a user name and password and then
click a button to enter a site.
You can find the sample source file, login.fla, in the Samples folder on your
hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\Login.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
Login.
String processing with
ActionScript
This sample demonstrates how to build a simple word processor that
compares and retrieves string and substring selections.
You can find the sample source file, strings.fla, in the Samples folder on
your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\Strings.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
Strings.
30 ActionScript
Image manipulation with the
BitmapData class
This sample demonstrates how to manipulate an image and create a
transition using the BitmapData class.
You can find the sample source file, BitmapData.fla, in the Samples folder
on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\BitmapData.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
BitmapData.
Text field manipulation with
ActionScript
This sample demonstrates how to create and position a text field,
manipulate its text, and control text selections.
You can find the sample source files, textfieldsA.fla and textfieldsB.fla, in
the Samples folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\TextFields.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
Te x t Fi e l d s .
Text field manipulation with ActionScript31
Photo gallery with tree navigation
This sample is a photo gallery application with tree navigation. It provides
an example of using components to control movie clips dynamically.
You can find the sample source file, gallery_tree.fla, in the Samples folder
on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\Galleries.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
Galleries.
Photo gallery with thumbnails
This sample is a photo gallery application with thumbnails. It provides an
example of using ActionScript to control movie clips dynamically.
You can find the sample source file, gallery_tween.fla, in the Samples folder
on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\Galleries.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
Galleries.
32 ActionScript
File upload with the
FileReference API
This sample demonstrates how to let users select a file on their hard disk
and upload it to a server. After the local image uploads, it appears in the
SWF file.
You can find the sample source file, FileUpload.fla, in the Samples folder
on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\FileUpload.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
FileUpload.
XML blog tracker
This sample demonstrates how to create a web log tracker by loading,
parsing, and manipulating XML data.
You can find the sample source file, xml_blogTracker.fla, in the Samples
folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\XML_BlogTracker.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
XML_BlogTracker.
XML blog tracker 33
XML language picker
This sample demonstrates how to use XML and nested arrays to choose
strings of different languages to populate text fields.
You can find the sample source file, xml_languagePicker.fla, in the Samples
folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\XML_LanguagePicker.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
XML_LanguagePicker.
XML menu
This sample demonstrates how to create a dynamic menu with XML data.
The sample calls the ActionScript
parameters: the path to the XML menu file and a reference to the current
timeline. The rest of the functionality resides in a custom class file,
XmlMenu.as.
You can find the sample source file, xmlmenu.fla, in the Samples folder on
your hard disk.
■ On Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ActionScript\XML_Menu.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/
XML_Menu.
XmlMenu() constructor and passes it two
34 ActionScript
CHAPTER 8
Data Integration
Several data integration samples are provided when you install Macromedia
Flash 8. This chapter contains a brief overview of each sample.
If you installed Flash Basic 8, you can view and explore these samples.
However, you can reconstruct the samples only if you installed Flash
Professional 8.
This sample provides an interface for reading the latest news on
Macromedia DevNet at www.macromedia.com/devnet. The addition of
the data-binding user interface in Macromedia Flash Professional 8 allows
you to build interfaces that connect to, retrieve, and display remote data
without writing any code. The new components have built-in data
awareness, allowing several possible scenarios with web services, XML
documents, and more. Explore this sample to see how these components
are connected to a Rich Site Summary (RSS) feed on
www.macromedia.com.
8
35
You can find the sample source file, DevNetNews.fla, in the Samples folder
on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\DataIntegration\NewsReader.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/DataIntegration/
NewsReader.
WebServiceConnector
component
This sample demonstrates how to use the WebServiceConnector
component.
You can find the sample source file, tips.fla, in the Samples folder on your
hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\DataIntegration\MacromediaTips.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/DataIntegration/
MacromediaTips.
36 Data Integration
Data integration XML sample
This sample is an XML file that you can use in the “Creating a simple
application” procedure in Using Flash.
You can find the XML file (dinner_menu.xml) in the Samples folder on
your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\DataIntegration\DinnerMenu.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/DataIntegration/
DinnerMenu.
Flash and PHP integration
This sample demonstrates how to use Flash and PHP (Hypertext
Preprocessor) integration to create a guestbook.
You can find the sample source file, guestbook.fla, in the Samples folder on
your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\DataIntegration\Guestbook.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/DataIntegration/
Guestbook.
Flash and PHP integration 37
38 Data Integration
CHAPTER 9
Extending Flash
As a Macromedia Flash user, you may be familiar with ActionScript, which
lets you create scripts that execute at runtime in Macromedia Flash Player.
The Flash JavaScript application programming interface (JavaScript API) is
a complementary programming tool that lets you create scripts that run in
the authoring environment (that is, while a user has the Flash program
open). These scripts can be used to help streamline the authoring process.
For example, you can write scripts to automate repetitive tasks, add custom
tools to the Tools panel, or add timeline effects.
Several JavaScript API samples are available when you install Flash 8. This
chapter contains a brief overview of each sample.
This sample displays information about the contours of the selected shape
in the Output panel.
You can find the source file for this script, Shape.jsfl, in the Samples folder
on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ExtendingFlash\Shape.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ExtendingFlash/
Shape.
For instructions on how to install and use this file, see “Sample Shape
command” in Extending Flash.
Get and set filters command
This sample adds filters to a selected object and displays information about
the filters in the Output panel.
You can find the source file for this script, filtersGetSet.jsfl, in the Samples
folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ExtendingFlash\filtersGetSet.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ExtendingFlash/
filtersGetSet.
For instructions on how to install and use this file, see “Sample get and set
filters command” in Extending Flash.
40 Extending Flash
PolyStar tool
This sample provides an example of adding a tool to the Tools panel using
the JavaScript API.
You can find the source file for this script, PolyStar.jsfl, in the Samples
folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ExtendingFlash\PolyStar.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ExtendingFlash/
PolyStar.
For instructions on how to install and use this file, see “Sample PolyStar
tool” in Extending Flash.
Trace Bitmap panel
This advanced sample illustrates how to design and build a panel to control
the functions of Flash.
You can find the sample source file, TraceBitmap.fla, in the Samples folder
on your hard disk. This file shows the use of the
call JavaScript commands from an ActionScript script.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\ExtendingFlash\TraceBitmapPanel.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ExtendingFlash/
TraceBitmapPanel.
For information on installing and running the sample, see “Sample Trace
Bitmap panel” in Extending Flash.
MMExecute() function to
Trace Bitmap panel 41
Sample DLL
Advanced users can use the C-level extensibility mechanism to implement
Flash extensibility files using a combination of JavaScript and custom C
code. You define functions using C, bundle them in a dynamic linked
library (DLL) or a shared library, save the library in the appropriate
directory, and then call the functions from JavaScript using the
JavaScript API.
A sample DLL implementation is located in the following folder:
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\
Samples
dllSampleComputeSum.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/ExtendingFlash/
dllSampleComputeSum.
For information about installing and using this sample, see “Sample DLL
implementation” in Chapter 3, “C-Level Extensibility,” in Extending Flash.
and Tutorials\Samples\ExtendingFlash\
42 Extending Flash
CHAPTER 10
Flash Lite
Several Macromedia Flash Lite samples are provided when you install
Macromedia Flash 8. This chapter contains a brief overview of
each sample.
This sample demonstrates two-way navigation in Flash Lite. In two-way
navigation, the device’s Up and Down arrow keys switch focus among
buttons and input text fields on the Stage, similar to how the Tab and
Shift+Tab keys function on a desktop computer.
For more information about two-way navigation, see “Modes of tab
navigation” in Developing Flash Lite Applications.
10
43
You can find the sample source file, 2-way.fla, in the Samples folder on
your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\FlashLite.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/FlashLite.
Four-way navigation sample
This sample demonstrates four-way navigation in Flash Lite. In four-way
navigation, the device’s Up, Down, Left, and Right arrow keys switch focus
among buttons and input text fields on the Stage.
For more information about four-way navigation, see “Modes of tab
navigation” in Developing Flash Lite Applications.
You can find the sample source file, 4-way.fla, in the Samples folder on
your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\FlashLite.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/FlashLite.
44 Flash Lite
Input text field sample
This sample demonstrates how to use input text fields to get text input
from users. For more information about how this sample was constructed,
see “Text field example application” in Developing Flash Lite Applications.
You can find the sample source file, input_text_example.fla, in the Samples
folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\FlashLite.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/FlashLite.
Movie clip menu sample
This sample demonstrates how to create a simple menu out of movie clips.
For more information about how this sample was constructed, see
“Creating a simple menu using movie clips” in Developing Flash Lite Applications.
You can find the sample source file, movieclip_menu_complete.fla, in the
Samples folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\FlashLite.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/FlashLite.
Simple button menu sample
This sample demonstrates how to create a simple menu using buttons. For
more information about how this sample was constructed, see “Handling
key events” in Developing Flash Lite Applications.
You can find the sample source file, simple_menu_complete.fla, in the
Samples folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\FlashLite.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/FlashLite.
Soft keys example
This sample demonstrates how to use the soft keys in a Flash Lite
application. For more information about how this sample was constructed,
see “Using the soft keys” in Developing Flash Lite Applications.
You can find the sample source file, softkeys_sample.fla, in the Samples
folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\FlashLite.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/FlashLite.
Soft keys example 45
Animated cartoon
This Flash Lite sample shows how to create an animated cartoon in Flash
Lite. The design shows the optimized use of vector and bitmap graphics to
create smooth animation on a mobile device.
Explore the source file to learn more, or customize it by creating your own
animated cartoon.
You can find the sample source file, FLAnimatedCartoon.fla, in the
Samples folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\FlashLite.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia/Flash 8/Samples and Tutorials/Samples/FlashLite.
Flash Lite news reader
This Flash Lite sample shows how to create a Flash Lite application to
connect to a website that reports news stories. The design is a classic
mobile design pattern: a user selects from a scrollable list of headlines and
can then select details to see the full story text in a scrolling text field, after
which the user can easily return to the main list.
Explore the source file to learn more, or customize it by creating your own
news reader.
You can find the sample source file, FLNewsReader.fla, in the Samples
folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\FlashLite.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/FlashLite.
46 Flash Lite
Strategy game
This Flash Lite sample shows how to create a Flash Lite strategy game
similar to the popular games Tetris and Breakout. The game uses the
handset’s joypad to navigate blocks dynamically drawn on the screen. The
joypad is the main input device for the game.
Explore the source file to learn more, or customize it by creating your own
strategy game.
You can find the sample source file, FLStrategyGame.fla, in the Samples
folder on your hard disk.
■ In Windows, browse to boot drive\Program Files\Macromedia\Flash
8\Samples and Tutorials\Samples\FlashLite.
■ On the Macintosh, browse to Macintosh HD/Applications/
Macromedia Flash 8/Samples and Tutorials/Samples/FlashLite.
Strategy game 47
48 Flash Lite
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.