• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

The World of Flash MX Professional 2004

The World of Flash MX Professional 2004

Macromedia Flash MX Professional 2004 (Flash Pro) represents a powerful tool for making professional Web sites. This book views Flash Pro as a rich integration of the traditional Flash tools, which make graphic animation and Web page development both effective and efficient, and the powerful new set of components and ActionScript 2.0, which allow for optimal development and object-oriented programming (OOP). Like any powerful application tool, Flash Pro consists of many elements, and the approach of this book is to explain these elements so that readers can get started relatively quickly creating professional sites for their clients. Some readers will come from a background rich in graphics and design, and others from one strong in development and programming. Still others have skills in both design and development. Because of the different backgrounds of professional creators of Web-based products, this book attempts to meld the different parts of Flash Pro into a single workflow rather than dissecting it into an unnatural dichotomy of “design” and “development.” Designers and developers can work as a team to create the best possible Web sites with Flash Pro, each providing their different expertise.

The extent to which designers and developers understand each other's tools and requirements in the context of the overall site will have a strong effect on the resulting Flash Pro application:

  • Designers need to know what can be done with ActionScript 2.0, and Flash Pro has some new tools in the Behaviors panel and some components that simplify adding ActionScript 2.0–based functionality. This book shows how to get started easily using ActionScript 2.0 as well as using its most advanced features. The reader can choose the level of scripting most suitable for his or her needs.

  • Developers need to understand the important design tools and the roles that those tools play in creating a site using Flash Pro. This doesn't mean that a programmer has to learn to be a designer, but rather he or she needs to be cognizant of the fact that most Flash programming occurs in the context of graphic-based designs. To get the most out of Flash Pro, developers have to work closely with designers and understand something about design needs. Such an understanding won't undermine efficient and effective coding; indeed, some of the code use, such as communicating with a back end and database, may have very little to do with understanding design. However, information put into and retrieved from a database must be entered through an input text field and retrieved through a dynamic text field that a designer has shaped for optimizing the user interface.

Who This Book Is For

This book is intended for designers and developers who want to use Macromedia Flash MX Professional 2004 to create commercial-quality Web pages and sites. As a book in the Sams Kick Start series, this text is intended to explain key elements of Flash Pro so that the reader can develop materials at an optimum rate.

The key groups this book addresses are quite varied, but the common thread among them is the focus on creating professional-quality materials using Flash Pro. Because time is money, this book doesn't linger on every nuance of Flash Pro. Rather, each topic is explained and illustrated with examples, graphics, and tutorials, and we move rapidly to the next topic.

The following groups will benefit most from this book:

  • Professional designers and developers who are familiar with previous versions of Flash— Depending on your area of expertise, you'll find this book covers everything new about Flash Pro. Therefore, by using this book's table of contents and index, you can go directly to those sections you want to learn about. Because this book integrates ActionScript 2.0 into discussions of various Flash Pro functions, you'll see how to integrate document construction with programming.

  • Professional designers new to Flash— Designers who have created Web sites for clients and want to add Flash to their array of design tools will find many of the design tools, especially the graphic design tools, familiar. If you're a designer, you can use this book to see how to use the design tools to create dynamic Web sites. If you're unfamiliar with programming, the new Behaviors panel in Flash Pro will let you add code without having to learn to program.

  • Professional developers new to Flash— Those with a programming background in languages such as Java, C++, JavaScript, and even BASIC (including Visual Basic) will find ActionScript 2.0 to be a very interesting and useful language. Because of the wide range of reader backgrounds, I briefly cover some basic concepts, such as object-oriented programming, variables, functions, and other basic terminology. If you're a programmer, feel free to skim those parts that cover familiar ground and spend more time seeing how ActionScript 2.0 is used in the context of creating Flash movies. It is important, though, to look at how Flash Pro deals with graphics and animation as well as with other design issues.

How to Use This Book

Treat this book as a tool, and use it accordingly. You can read it from cover to cover, read it in any order that suits your needs, or just jump in and look up what you need when you need it. You'll probably find it useful to employ some kind of page-tabbing system to mark those sections you need to use most often. (I've devised a color-coded system in which I place a sticky tab in different key pages.) If you're a designer, you shouldn't get bogged down in learning ActionScript 2.0 unless you've purchased this book for that purpose. Instead, you should use other Flash Pro tools to get a job done, including the new Behaviors panel that automatically generates ActionScript programs. Later, when you don't have a job deadline, you can go over the ActionScript sections and learn how to use different code to accomplish new tasks. There's no rush.

Most of the chapters have elements of ActionScript-based and non-ActionScript-based materials. You can go over some, all, or none of the materials in each chapter to find what you need to get a job done. Most chapters contain multiple small projects that employ several of the features discussed in a particular chapter. If you like, you can first code the chapter's sample projects (or download them from www.sandlight.com) and then read the rest of the chapter to see how all the parts come together.

You can quickly find ActionScript 2.0 features, and depending on your background and needs, pick up the new features. It's important to see how the core of Flash works if you're unfamiliar with it so that you can use ActionScript optimally.

The “best” way to use this book depends on how you best learn new material. Because the book is for professional use, it's designed to be sitting next to your computer when you sit down to construct a jaw-dropping creation.

Flash Origins

Flash's initial popularity stemmed from being a very efficient tool for creating low-bandwidth animations for the Web. At the core of Flash is the use of vector graphics and symbols. Vector graphics have less “bulk” because they use vector points and algorithms for drawing lines between the vector points. Such graphics take up less computer memory than bitmapped graphics, which map all the bits in a graphic. Figures I.1 and I.2 show how a vector graphic appears on a Flash page and the lack of distortion as the image is magnified.

Figure I.1. Vector graphics use less memory than bitmapped graphics.

Figure I.2. When bitmapped graphics change in size, they become distorted compared to vector graphics.

Flash uses symbols to store information about different shapes that can be used as movie clips, buttons, and graphic images. A symbol represents an object that can be replicated in a Flash movie without you having to send over the Internet the entire graphic that makes up the symbol. Therefore, you can use a single button symbol to create several identical buttons, but because only the button symbol is sent across the Internet, the bandwidth costs are a fraction of what the same number of buttons would be if they were sent as individual graphic objects. Figure I.3 shows a graphic comparison.

Figure I.3. HTML requires the same graphic loaded four times, whereas Flash requires only a single symbol to be loaded.

Flash also introduced the Timeline, frames, and layers for creating animated movies. The Timeline, with its moving playhead, is a metaphor borrowed from animated films where the cels (the individual movie frames created using drawings on sheets of cellophane) are hand-drawn animations. This greatly simplified the making of computer-based animations for the Web. The automatic in-betweening work (drawings between keyframes) in animation is automatically handled through the “tweening” process in Flash. Therefore, not only is creating animations analogous to the traditional methods favored by animators, but it is far more effective and efficient as well.

As more Web site designers and developers discovered Flash, they adopted it for movie and game animation work and adding flair to their sites. One result was a flood of animated banners and other bouncing and distracting visuals that came to decorate sites and infuriate users. Unfortunately, Flash came to be identified as a narrow animation tool and not a full-site development tool.

With the advent of Flash MX, several user interface (UI) components were added, along with a far more robust version of ActionScript. Designers were able to add these components to their sites easily as well as add their own design colors. Developers could use the new ActionScript to create class-like functions using the prototype property. Likewise, a whole new set of ActionScript terms moved the language much closer to the European Computer Manufacturers Association (ECMA) standard, known as ECMAScript. The result was that Flash, while keeping its original core, moved into the realm of a full Web site–creation tool.

We're Not in Kansas Anymore: Approaching Flash Pro

Macromedia Flash MX Professional 2004 represents a quantum leap in the development of Flash. With the basic animation and bandwidth-saving structures still in place, Flash Pro has all the characteristics of a full Web site–development tool. Rather than being just an animation tool, Flash Pro has the capability to replace HTML, XHTML, and JavaScript. Moreover, Flash Pro can accomplish more than the combined traditional tools centered around HTML because Flash contains components, buttons, movie clips, and the capability to work with all the external files that HTML can. This doesn't mean that Flash Pro doesn't use HTML. When Flash movies are published, an HTML file is generated to contain the SWF file. Flash Pro calls for a shift in thinking—that is, you need to think of it as something more than just a tool for making Flash animations. A quick overview of Flash Pro's key features will help.

A Tale of Two Flashes

This is the first time that Flash has been available in two different product packages. In a nutshell, Macromedia Flash MX Professional 2004 differs from the standard version of Macromedia Flash MX 2004 in that Flash Pro contains additional features. If you're considering Flash Pro and using this book to decide whether it's worth the extra cost, this section is for you because it gives you a better idea of what's found in Flash MX Professional 2004 that's not available in Flash MX 2004.

Flash Pro has all the components, classes, and other features that the standard version of Flash has, but it also includes the following new components and classes (I'll discuss some of these shortly):

  • Accordion component

  • Alert component

  • DataBinding package

  • DateField component

  • DataGrid component

  • DataHolder component

  • DataSet component

  • DateChooser component

  • Form class

  • Menu component

  • RDBMSResolver component

  • MediaController component

  • MediaDisplay component

  • MediaPlayback component

Other features unique to Flash Pro are the Project panel and external data-editing capabilities. What's more, the highly productive Forms and Slide feature is only found in Flash Pro.

The real difference between Flash Pro and the standard version is that Flash Pro is for professional development. The enhancements in Flash Pro cut down on the number of hours required to develop sophisticated documents in Flash, and they more than make up for the cost difference in short order.

Multiple Start Options

When starting Flash Pro, you'll notice a new feature—the graphic list of options (see Figure I.4). Old hands at Flash should familiarize themselves with what's new here. Each of these options is discussed in detail in different chapters in the book, but here a quick overview will show you what's available.

Figure I.4. You have a number of different options when starting Flash Pro.

Three columns of choices make the selection options clear. In the first column, the option for opening a recent or other item is now on the Stage instead of only in the File menu. The second column not only provides familiar options from the File menu but also several other previously unavailable options:

  • Flash Document— Opens a new blank Flash movie.

  • Flash Slide Presentation— Available only in Flash Pro, this option opens a two-column document ready for using slides (see Chapter 9, “Producing Online Slide Shows”).

  • Flash Form Application— Available only in Flash Pro, this option opens a two-column document set up for inserting forms (see Chapter 9).

  • ActionScript File— Available only in Flash Pro, this option opens an Integrated Script window for creating Dealing with External Data and Object AS files. It's similar to the Actions panel, but all scripts are saved in external files and not integrated into the FLA source. However, it does support syntax coloring, code hints, and other scripting aids found in the Actions panel (see Chapter 4, “Animations and Interactions).

  • ActionScript Communication File— Available only in Flash Pro, this option opens an Integrated Script window that is used for creating server-side ActionScript to be saved in ASC files used with Flash Communication Server MX.

  • Flash JavaScript File— Available only in Flash Pro, this option opens the Flash JavaScript Editor and is used in conjunction with the Flash JavaScript API. You can create JSFL files that can be used with multiple scripts.

  • Flash Project— Available only in Flash Pro, this option creates a Flash Project file that can be used to coordinate multiple developers/designers and pull together the different files used in a single project (see Chapter 3, “Adding ActionScript to Your Animation”).

For those familiar with Flash, these new central options provide far more functionality than what was previously available.

The final column provides a set of templates. These templates are FLA files that you can fill with unique content. For getting a true kick start in using Flash Pro's power, working with templates is a good idea. The following templates are provided:

  • Advertising— Several different layouts with minimum content are provided as design stages. The layouts represent typical ones you're likely to find in banner ads and other ads embedded in an HTML page or as part of a larger Flash page.

  • Form Applications— Found in Flash Pro only, these templates help in creating forms quickly (see Chapter 9).

  • Mobile Devices— These templates help you create Flash movies used in mobile phones and PDAs that can read the new Flash Lite 1.0 player or the older Flash Player 5. Included in the templates are graphic representations of various mobile devices and their display screens to help you plan a movie that can be seen on different devices. Figure I.5 shows the layout for a Nokia phone.

  • Photo Slideshows— This template allows you to quickly put together a user-controlled or automatically timed slide show.

  • Presentations— Several layouts provide boilerplates for different style presentations. The materials provide PowerPoint-type presentations using Flash Pro.

  • Quiz, Remoting, Slide Presentations— Several different layouts with minimum content are provided as design stages.

  • More... (Video)— The video template uses both media components and forms to show how video can be integrated into different applications.

Figure I.5. The work area (or Stage) is made up of the mobile device's viewing area.

Graphic Tools

In developing a site for the Internet, Flash Pro provides graphic tools for creating graphics right on the Stage. The Tools panel has a basic set of tools for creating vector graphics. For those familiar with previous versions of Flash, you'll see that very little has changed in the Tools panel (previously called the Toolbox). The same graphic tools available in Flash MX are still there. The look has changed slightly, but other than the new PolyStar tool, little has changed. Chapter 2, “The Flash Pro Interface,” shows you how to use the different tools.

Graphic File Importer

In addition to creating your own graphics in Flash Pro, you can import both bitmapped and vector graphics into Flash. Graphics from programs such as Macromedia FreeHand MX 2004, Macromedia Fireworks MX 2004, Adobe Illustrator, Adobe PhotoShop, Paint, and many other formats can be easily imported and used in Flash Pro movies. New in Macromedia Flash MX Professional 2004 is the ability to import PDF files. Chapters 2 and 3 introduce you to how to work with imported graphic files.

Video Store

As a tool for creating animated movies for the Internet, Flash is unsurpassed. However, it can also import and play digital video files that can be placed into layers where keyframes will be created automatically to accommodate the video. The new version of Flash can also stream external FLV files. Additionally, if AVI or MOV files are imported into Flash Pro, they can be exported as FLV files. Streamed files are important because they're streamed directly from the server; therefore, users don't have to wait while the files are downloaded prior to viewing them. Likewise, because streamed files need not be part of the SWF file, the Flash file will load and play much faster. Chapter 10, “Adding Video and Sound,” shows you how to get the most out of video using Flash.

Flash Pro also comes with three new components for placing streaming video into a Flash movie:

  • MediaController

  • MediaDisplay

  • MediaPlayback

Figure I.6 shows a streaming video in the MediaPlayback component. Designers and developers alike can quickly install streaming videos into their Flash productions simply by providing the path to the FLV file entered into the Component Inspector.

Figure I.6. Adding streaming video using the MediaPlayback component.

You will find support for the following video applications in Flash Pro:

  • Avid Xpress/Media Composer

  • Apple Final Cut Pro

  • Discreet Cleaner

  • Anystream Agility

  • After Effects

With this broad range of support plus its own built-in capacity to deal with video, Flash Pro can be an excellent platform for streaming video across the Internet.

Sound Platform

In addition to graphics, both static and animated, Flash Pro handles sound files as well. Sound files, including WAV, AIEE, and MP3 formats, can be imported into Flash. Once in Flash, WAV and AIEE files can be compressed into MP3 format for a smaller-size SWF file to be sent over the Internet.

You can use Flash Pro's sound editor to edit the sound envelope, and using the Property panel, you can synchronize the sound with actions on the Stage. Because the sound is embedded in the SWF file, no separate sound loading is required. Chapter 10 shows how to import sound into Flash and even how to separate the sound from an imported video file.

User Interface

One of the most important features in Flash Pro is the inclusion of user interface (UI) components. The area of computer human interface (CHI) or human computer interface (HCI) is one that cannot be ignored in creating professional sites for clients. Flash MX Professional 2004 includes an expanded set of the UI components originally introduced in Flash MX. Included in the new set are the components detailed in Table I.1.

Table I.1. New UI Components in Flash MX Professional 2004
AccordionA sequential display component
AlertAn alert window
ButtonA graphic push button
CheckBoxA graphic check box
ComboBoxA pop-up menu box
DataGridA column-enabled data display component
DateChooserAn onscreen calendar for selecting and displaying a date
DateFieldA component that displays a date that can be selected from a pop-up calendar
LabelA text-labeling component
ListA scrollable options box
LoaderA component used to load and display SWF and JPG files
MenuA drop-down menu with selectable items
MenuBarA horizontal bar on which you can place Menu components
NumericStepperA button-operated component that displays numbers the user can increment or decrement by clicking an up/down arrow
ProgressBarA bar used with preloaders to show loading progress
RadioButtonUsed to create a mutually exclusive set of selectable radio buttons
ScrollPaneA window that can contain text and graphics and can be scrolled horizontally and vertically
TextArea (includes neededAn expandable area where text can be added, with an auto scrollbar appearing when a scrollbar)
TextInputAn input text field with depth
TreeDisplays hierarchal nodes of data from an XML file
WindowDisplays a movie clip in a window with a title bar and border along with an optional close button

Flash MX Professional 2004 has almost three times the number of UI components Flash MX originally contained. The presence of these components represents Macromedia's commitment to making Flash Pro a truly powerful Web development tool for professional applications beyond animation. By including the expanded number of UI components, Macromedia has shifted the focus toward the professional requirements for an Internet site for business, education, and public service organizations.

Back-End Portal

Flash has longed served as a stable front end for communicating with a back end through a connector. Flash Player 7 contains a security system for external data and files; therefore, Flash can be used as a secure front end. All connections to external data are subject to Flash's sandbox security. This type of security restricts a Flash document from data (including data passed through middleware such as ColdFusion, PHP, or ASP.NET) emanating from a domain other than the originating one. For example, if I use my domain, www.sandlight.com, to store my Flash files, I need to put my database and middleware on www.sandlight.com. The new data components detailed in Table I.2 can be used with different types of data sources.

Table I.2. New Data Components in Flash MX Professional 2004
DataHolderServes as a data-holding connector between other components using data binding.
DataSetAssists in working with data as collection of objects.
RDBMResolverUsed in conjunction with the DataSet component. Assists in reformatting data for appropriate display.
WebServiceConnectorUsed to connect to a live Web service such as a stock ticker or the current weather.
XMLConnectorReads data from an XML file or writes in XML format for POST and GET operations.
XUpdateResolverThis component converts changes made to the data in your application into an appropriate format for updating the external data source in use.

This arrangement improves security. However, if the developer has PHP files communicating with a MySQL database on a Linux server and ASP.NET software communicating with a Microsoft SQL Server database on a Microsoft 2003 server, the sandbox security prevents a single Flash document from accessing both. To resolve this problem, Flash has procedures in place to permit cross-domain access to data. Chapter 11, “Formatting and Calculating,” explains how to use sandbox security and how to get around it for cross-domain data access.

Internet Programming Tool

When ActionScript was initially introduced in Flash, it stood as a support system geared primarily toward jumping from one frame to another within a Flash movie. However, as ActionScript developed, making huge leaps in Flash 5 and Flash MX, it took on a life of its own, having much the same functionality as JavaScript plus its original unique Flash functionality. In Flash MX Professional 2004, the change has been so significant that the language has been recast as ActionScript 2.0 (AS2).

ActionScript 2.0 takes its naming convention from JavaScript 2 (that is, being developed to conform to the new ECMA-262 standards for Internet languages). More specifically, ECMAScript Edition 4 (or ECMA-262 Edition 4) is developed to bring true object-oriented programming (OOP) to Flash. For developers used to programming in Java or C++, the new features of ActionScript 2.0 should be very familiar. However, to those who are new to programming or used to the process model dominant in previous versions of ActionScript, ActionScript 2.0 will require some study. Those new to programming will be starting off with a very good and powerful programming model and won't have to transition later on to object-oriented programming.

Also, Flash Pro provides options for nonprogrammers to get started quickly using the new Behaviors panel for automatically generating ActionScript 2.0 code. Although some important changes have been made to ActionScript 2.0, you can still use most of the basic ActionScript 1.0 code and procedures, such as play() and stop().

What's New in Flash MX Professional 2004?

This section provides a quick overview of what's new in Flash Pro. Many of these new features have been discussed elsewhere in this introduction:

  • Accessibility support is offered in the components and the Flash authoring environment. Keyboard shortcuts allow for non-mouse interfaces. Components allow for improved third-party closed-caption and screen reader programs.

  • ActionScript 2.0 is a true object-oriented language in line with ECMA-262 Edition 4.

  • The Behaviors panel helps nonprogrammers add ActionScript 2.0 to their documents. Functions include scripts that link to Web sites, control the playback of embedded videos, play movie clips, load sounds and graphics, and trigger data sources. For more information, see “Controlling Instances with Behaviors” in the Using Flash Help.

  • Components have been added for data, media, and user interface enhancement.

  • Data binding allows you to connect any component to a data source. Data updates and manipulation can be accomplished through ActionScript 2.0 or the components.

  • Document tabs make working with multiple documents and documents that use external files much easier.

  • File import enhancements allow for importing Adobe PDF and Adobe Illustrator 10 files and preserving vector representations of original source files.

  • Find and Replace has been a part of the ActionScript panel in previous versions of Flash, and it is now available for locating and replacing text strings, fonts, colors, symbols, sound files, video files, and imported bitmap files in a document.

  • Flash Player detection lets you determine the Player version the user has in his or her system.

  • Flash Player performance is enhanced. It now complies with the ECMAScript language specifications. Also, the Player has much improved runtime performance, video scripting, and display rendering.

  • Form screens comprise a forms-based visual programming environment for optimizing development.

  • The Help system includes a new Help panel with context-sensitive references and ActionScript references, in addition to lessons in using Flash.

  • The History panel has been added to the panel set. It tracks user actions for possible conversion to reusable commands.

  • Multilanguage authoring using enhanced globalization and Unicode support with any character set assists with international authoring.

  • The Project panel allows for team design and development on a single project. File management, version control, and efficient workflow have been added to document development.

  • Publish profiles allow the user to save, reuse, and export documents. This new feature aids in cross-document consistency.

  • Security is stricter in the Flash Player, including exact domain matching. The Flash Player also distinguishes between HTTPS and HTTP, thus adding further security.

  • Screen-based visual development environment, slide screens, and form screens help create slide shows and form-based applications.

  • Small font sizes have improved rendering with improved appearance.

  • Source code control integration with plug-ins to source control systems such as Microsoft Visual Source Safe help protect source code from decompiling.

  • Spell Checker searches your text on the Stage and in movie clips for spelling errors. This is a real lifesaver when you use a lot of text in Flash documents.

  • The Start page has been enhanced to display far more options.

  • The Strings panel eases the publication of content in multiple languages.

  • Templates have been added to Flash for making presentations, e-learning applications, advertisements, mobile device applications, and other templates handy for Flash documents. (The templates are not new, but the content and form are.)

  • Timeline effects allow users to apply effects to objects on the Stage. Transitions, fade in and out, spins, and blurs are all made simple using this new feature.

  • Video Import makes video encoding easier and offers encoding presets and clip editing.

  • Web Services include ready-to-use data connectors for Web services.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint