Flash
  Home arrow Flash arrow Page 2 - 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  
Mobile Linux 
App Generation ROI 
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.1 Determining How a Movie Will Download


    (Page 2 of 7 )

    Problem

    You want to test the playback of a movie simulating different connection speeds, identify frames with assets too large to play back progressively, and/or determine whether you need a preloader.

    Solution

    Use the Bandwidth Profiler.

    Discussion

    The Bandwidth Profiler is available within the testing environment in Flash. That is, it is accessible when you test a movie by choosing Control -> Test Movie. To access it, choose View -> Bandwidth Profiler. The top half of the test player displays the Bandwidth Profiler.

    The Bandwidth Profiler analyzes the file size of assets needed to download in each frame and plots the file size as bars on a graph. The values on the left side of the bar vary based on the size of the assets in the movie. The bottom line on the graph, or stream limit, shown in red, represents the dividing line between movies that will stream acceptably and those that may have problems during playback. If any frame has a column extending beyond the stream limit, the movie is unlikely to play back acceptably. Figure 20-1 shows a movie with bitmaps placed every fourth frame. All of these frames extend far beyond the stream limit; this movie would need a preloader to ensure acceptable playback.

    The value of the stream limit is relative to the connection speed and frame rate. That is, if you have Flash simulate playback for a 56K modem at 12 frames per second, the


    Figure 20-1.  A movie needs a preloader when it contains frames that exceed the red line

    line will appear at 400 bytes. However, if you change the playback simulated setting to a 28.8 modem, the line will appear at 200 bytes. If you increase the frame rate to 24 frames per second for a 28.8K modem, the line appears at 100 bytes because the content would essentially have to download twice as fast as it did when the frame rate was 12 frames per second in order to keep up with the playback.

    You can change the connection speed by selecting it from the View -> Download Settings menu. Built-in options range from 14.4K modems to T1 connections. You can also create your own custom settings by selecting the Customize option from that same menu.

    In addition to seeing the graph depicting how a movie will download, you can have Flash simulate the download for a given bandwidth. Specify the connection speed in the View -> Download Settings menu, and then select View -> Show Streaming, or press Control-Enter (Windows) or Command-Return (Macintosh). Flash plays back the movie at the specified rate, pausing to simulate frames that have not yet downloaded.

    The Bandwidth Profiler has two practical limitations:

    • The Bandwidth Profiler can estimate how well a movie will stream only for a given setting. Other factors, such as network congestion, the quality of the phone line (for modem users), and demands on the server also affect how quickly content is downloaded.
    • When Show Streaming is active, Flash simulates the download of the current .swf file. It also simulates the download of assets (JPEG, GIF, PNG, or MP3) that is loaded at runtime using MovieClipLoader or Sound if the assets are loaded using a relative URL. However, it will not correctly simulate the download of any .flv files, or simulate the download of any assets that use an absolute URL.

    See Also

    Recipe 20.2

    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

    - Decorator Pattern
    - Organizing Frames and Layers for Flash Anima...
    - Organizing Frames and Layers
    - 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






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT