When it comes to effective visual communication, keeping the attention of your audience is a challenge. Designing engaging and meaningful content requires thinking outside the box and leveraging a wide range of design tools, including vector-based animation, with a purpose—to tell a story, explain a concept, demonstrate a procedure, or simply entertain.
Flash Catalyst does an excellent job with smooth transitions using simple fades and movement. You can also produce more elaborate animation using other Adobe Creative Suite tools and then publish your movie as a SWF file. The SWF file is imported as an asset in your Flash Catalyst project.
In this lesson, you’ll learn how to do the following:
• Use SWF files in Flash Catalyst projects
• Add SWF files to an application
• Control the playback of a SWF file
• Play a SWF file from a specific frame
• Create an animated button using a SWF file
This lesson will take about 40 minutes to complete. Copy the Lesson09 folder into the lessons folder that you created on your hard drive for these projects (or create it now), if you haven’t already done so. As you work on this lesson, you won’t be preserving the start files; if you need to restore the start files, copy them from the Adobe Flash Catalyst CS5 Classroom in a Book CD.
SWF, pronounced swif, is short for Shockwave Flash and is the dominant format for displaying animated vector graphics and text, as well as sound and video, over the Internet. The SWF file format delivers vector graphics, text, video, and sound and is viewed using Adobe Flash Player and Adobe AIR software. Flash Player reaches over 98 percent of Internet-enabled desktops and more than 800 million hand helds and mobile devices.
Browse the web and you’ll find page after page of computer programs for publishing your finished web content in the SWF file format. These include several Adobe Creative Suite applications and a long list of third-party programs.
You can use the following Adobe applications to output SWF files:
• Adobe Flash Professional CS4 or CS5 (recommended for Flash Catalyst SWF content)
• Adobe Premiere Pro
• Adobe After Effects
• Adobe Encore
• Adobe Fireworks
• Adobe InDesign
• Adobe Illustrator
• Adobe Media Encoder
• Adobe Captivate*
• Adobe Presenter*
With so many applications capable of outputting SWF content, there’s a lot of potential to leverage existing materials in your rich Internet applications. However, it’s important to know that not all SWF content is created equal. Take a few minutes to review the following tips before acquiring SWF content for use in your Flash Catalyst projects:
• Controlling the playback of SWF content in Flash Catalyst. You can add Flash Catalyst effects in the Timelines panel to control the playback of a SWF file. Only SWF content written in ActionScript 3.0 and published using Adobe Flash Professional can be controlled using Flash Catalyst effects.
• Importing Flash Professional SWF content. You can import SWF files created in Flash Professional into Flash Catalyst, but there is no direct integration between the two applications. If you need to edit the SWF file, make your changes in Flash Professional, republish, and import the new file into Flash Catalyst. Then, select the SWF Asset in your application and use the Source link in the Properties panel to swap the old SWF file for the new one you’ve added to the library.
• Loading content dynamically. Many SWF files are complex interactive applications that load content dynamically at runtime. For example, a movie.swf file may include a link to video stored externally in a folder named My Video. You can import the movie.swf file into Flash Catalyst, but you’ll need to manually copy the source video to your published Flash Catalyst project folders. The linked video must maintain the same position relative to Main.swf that it had relative to movie.swf. For example, if the video is stored in the My Video folder next to movie.swf, then copy the My Video folder and paste it next to the Main.swf file that’s created when you publish your Flash Catalyst project. If you publish more than one version of the application (for example, web, offline, AIR), you’ll need to manually copy the video to all locations.
If you publish lots of SWF content that includes TLF text, you can save a custom publish profile for repeated use. To save a publish profile, select your preferred settings and click the Create New Profile button (+) in the Publish Settings dialog box. Enter a name for the profile and click OK.
• Merging a shared library. Flash Professional CS5 includes two types of text—Text Layout Framework (TLF) and Classic. TLF was introduced with Flash Professional CS4 and is the new default way to create text in Flash Professional. TLF text delivers multilingual, print-quality typography for the web and offers formatting not possible with Classic text. When publishing SWF files that include TLF text, the Flash Professional CS5 default is to generate two files, a SWF file and a SWZ file. The SWZ file is a text layout library. You must merge the shared library into the underlying code of the SWF file before you can use the SWF file in Flash Catalyst.
To merge a shared library in Flash Professional CS4:
There is a lot of really good, royalty-free SWF content available that can be a great addition to your Flash Catalyst projects.
When you import a SWF file into Flash Catalyst, it’s stored as an asset in the Images category of the project library. An instance of the SWF file is added to the current state automatically. You can share that same instance of the SWF file to other states just like you can with images, video, and other objects. Once you’ve imported the SWF file to the library, you can use it anywhere in your application by dragging it from the Library panel to the artboard.
If you import more than one SWF file at the same time, the files are added to the project library, but no assets are added to the artboard until you drag them from the Library panel.
Remember that each time you drag a SWF file from the Library panel to the artboard, you are creating another instance of the asset in your application. If you want the SWF file to appear in more than one state, then add one instance and then share that same instance to the other states.
Let’s add the animated logo for the Restaurant Guide application. The logo is a SWF file that we can import directly to the artboard.
This file is an interactive restaurant guide. An animated logo belongs at the top of the page. The logo was created and published as a SWF file.
The SWF movie appears in the artboard on the Home page and the SWF Asset appears in the Layers panel.
The first frame of the SWF movie is visible in the artboard. The entire content of this SWF file is located in Frame 1 of the movie, including the animated flag, so you don’t need to play the movie to see it.
The SWF file is added to the top of the SubPages state.
You can’t preview a SWF movie in the Flash Catalyst Library panel the way you can a video or still image, but you can preview the movie by running the project.
The SWF icon appears in the preview window in the Library panel.
In a browser, you can see the SWF movie. In this case it looks just like it did in Flash Catalyst, because the entire contents of the movie are occurring in a single frame.
Most SWF files consist of more than one frame, and many involve internal navigation or other interactivity. For these SWF files, you’ll need to add an interaction that tells the movie when to play or stop. You can even tell the SWF file to begin playing or stop on a specific frame within the movie.
To play or stop a SWF file, add an interaction that triggers an action sequence when someone clicks or rolls over a component or group, or when the application starts. In the action sequence, add an effect to control the playback of the SWF file.
To see how this works, let’s add an On Application Start interaction that plays a SWF file automatically when someone opens the application.
A new SWF Asset is added to the top of the artboard and appears in the Layers panel, inside the SWF folder. You may need to expand the SWF folder to see the SWF Asset in the Layers panel.
This SWF file begins transparent in Frame 1 and fades into view during the first 20 frames of the movie, so you don’t see much in the artboard.
Because nothing is selected in the artboard, the interaction defaults to On Application Start.
The new On Application Start action sequence is selected in the Timelines panel.
A Play SWF effect is added to the On Application Start action sequence in the Timeline.
The SWF movie begins playing as soon as the application starts.
The application links at the top of the window aren’t connected to any pages yet, but you can test the SWF file by clicking its right and left arrow keys.
You can tell the movie to begin playing on a specific frame in the SWF file’s main timeline. This allows you to build controls in Flash Catalyst that go to and play or stop at different locations within the SWF movie.
Deleting the effect does not remove the action sequence, only the effect. The On Application Start action sequence is still selected in the Timelines panel.
The Go To Frame And Play effect appears in the Timeline.
This tells the action sequence to begin playing the SWF movie at Frame 31 of its main timeline.
In this activity you use a Go To Frame And Play effect to begin a movie at Frame 31, but why Frame 31? This is a starting point of another section in the movie, but you can just as easily go to any other frame. Having knowledge of the SWF file’s main timeline will help determine which frame to use in a Go To Frame And Play (or Stop) effect.
This time when the application starts, the SWF movie plays automatically, but it begins on Frame 31.
You can use an imported SWF file to bring buttons and other components to life by using creative animation techniques that aren’t available in the current Flash Catalyst collection of effects.
To illustrate this, let’s add some animation to a sample button. We’ve already created a simple animated SWF file of two gears rotating in opposite directions. This will be a nice complement to our button.
First, you need to position the SWF file on the sample button.
The file includes a navigation button that’s partially designed. To complete the button, you will add a SWF animation.
The button opens with the Up state selected.
The SWF Asset is added as a new object in the Button component layers.
With the SWF Asset in all states of the button, you can use transition effects to control when the animation is playing or stopped.
The play effect is added to the transition between the Up and Over states of the button.
The stop effect is added to the Over > Up transition.
When you roll over the button, the SWF animation plays and the gears appear to spin in opposite directions. When you move the pointer away from the button, the animation stops.
1 What is the recommended application for creating SWF content for use in Flash Catalyst projects?
2 What types of SWF files can be controlled using interactions in Flash Catalyst?
3 Does Flash Catalyst support SWF files that include links to external data, such as video that loads at runtime?
4 If a SWF file includes Text Layout Framework (TLF) text, what must be done to the file before it will play correctly in Flash Catalyst?
5 How do you preview a SWF file?
6 When does a SWF file play automatically without adding any type of interaction or transition effects in Flash Catalyst?
7 What are two ways to add play or stop controls to a SWF file in Flash Catalyst?
1 The recommended application for creating Flash Content is Adobe Flash Professional CS4 or CS5.
2 Only SWF content written in ActionScript 3.0 and published using Adobe Flash Professional can be controlled in Flash Catalyst.
3 Flash Catalyst supports SWF files with links to external files, but the linked content must maintain its original position relative to the SWF file being imported. If you publish more than one version of the application, you’ll need to manually copy the linked content to all locations in the published directories.
4 Flash Professional includes two types of text: Text Layout Framework (TLF) and Classic. When publishing SWF files that include TLF text, Flash Professional’s default is to generate two files, a SWF file and a SWZ file. The SWZ file is a text layout library. You must merge the shared library into the underlying code of the SWF file before you can use the SWF file in Flash Catalyst.
5 To preview a SWF file, you must run the project in a browser or publish the project. You cannot preview a SWF file in the Library or Timelines panels.
6 If the entire SWF movie occurs in the first frame of its internal main timeline, the SWF file plays without adding controls in Flash Catalyst.
7 You can control a SWF file in Flash Catalyst by using an action sequence with a SWF Control effect. You can also add the SWF file to the Up and Over states in a Button component and then add a SWF Control effect to the transitions between states.