Flash
  Home arrow Flash arrow Page 6 - Building Preloaders
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
FLASH

Building Preloaders
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 16
    2007-02-22

    Table of Contents:
  • Building Preloaders
  • 20.1 Determining How a Movie Will Download
  • 20.2 Building a Simple Preloader
  • 20.3 Building a Preloader that Displays Load Percentage
  • 20.4 Using a Progress Bar to Create a Graphical Preloader
  • 20.5 Creating Preloaders for Files with Exported Symbols
  • 20.6 Creating Preloaders for Files with Components

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building Preloaders - 20.5 Creating Preloaders for Files with Exported Symbols


    (Page 6 of 7 )

    Problem

    Your have a file that exports movie clips for ActionScript, and you want to add a preloader.

    Solution

    Use the same preloader principles discussed earlier in this chapter. In addition, uncheck the “Export in first frame” option for each exported movie clip within the library.

    Discussion

    As you learned in Recipe 11.17, you can tell Flash to export a movie clip symbol even if it is not used at authoring time. That enables you to programmatically add instances of the movie clip using ActionScript. With a few simple movie clips exported for ActionScript, you won’t likely notice any effect on the preloader. However, with many complex (particularly bitmap) movie clips that are exported for ActionScript, you may start to notice that the preloader doesn’t appear immediately. It’s possible that the preloader may not even appear until most of the file has downloaded. This is due to the default setting for movie clips exported for ActionScript—they are set to export on the first frame. Thus every exported movie clip must download before Flash will play back even the first frame.

    There is a relatively simple solution, however. Although the default setting is such that Flash-exported movie clips are exported on the first frame, you can tell Flash to use an alternate frame instead, with the following steps:

    1. Uncheck the “Export in first frame” option for each movie clip symbol. You can access the option from the Linkage properties dialog box. By default, the “Export in first frame” option is checked when you check the “Export for ActionScript” option. However, when the “Export for ActionScript” option is selected, you can independently toggle the state of the “Export in first frame” option.
    2. Place instances of the movie clips on the stage at authoring time. That way Flash knows what frame to use in order to export the symbol.

    The second step may seem counterintuitive. However, it is simply the way in which you communicate to Flash where to export the symbol. The dilemma that arises is then that you frequently don’t want those symbols to appear in the exported movie on any frame unless they were placed there with code. So placing an instance on the stage at authoring time seemingly defeats the purpose, or at least causes an obstacle. The solution is to approach the Flash project in a somewhat nonlinear fashion. Even though a timeline plays from first frame to last frame by default, there’s no reason it has to do that. As you’ve already learned, you can use simple ActionScript commands to tell Flash to stop, play, and jump to any frame within a timeline. Therefore, you can always place the movie clip instances on a frame that is never played. For example, you can place the preloader on frame 1, the movie clip symbol instances on frame 2, and then the actual content starting on frame 3. Within the script on frame 1, you can instruct Flash to jump to frame 3 once the file has downloaded.

    More Flash Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Flash 8 Cookbook," published by O'Reilly....
     

    Buy this book now. This article is excerpted from chapter 20 of the Flash 8 Cookbook, written by Joey Lott (O'Reilly, 2006; ISBN: 0596102402). Check it out today at your favorite bookstore. Buy this book now.

    FLASH ARTICLES

    - Using XML and ActionScript with Flex Applica...
    - Interfaces and Events with ActionScript and ...
    - Manipulating Data with ActionScript in Flex ...
    - ActionScript Syntax for Flex Applications
    - ActionScript in Flex Applications
    - A Closer Look at Apollo`s File System API
    - Using the File System API
    - ActionScript 101
    - Flash Buttons
    - Advanced Flash Animation
    - Creating Your First Animated Movie with Flas...
    - Flash: Building Blocks
    - Building Preloaders
    - Fun Things to Do with Movie Clips in Flash MX
    - Referencing Movie Clips in Flash MX







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway