Flash
  Home arrow Flash arrow Page 4 - Working with external data in Flash
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 
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

Working with external data in Flash
By: Adi Reddy Mora
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 25
    2005-05-11

    Table of Contents:
  • Working with external data in Flash
  • getURL(), loadVariables(),loadVariablesNum(), loadMovie(), and loadMovieNum() methods
  • LoadVars Class
  • MovieClipLoader class
  • XML Class
  • XMLSocket Class

  • 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


    Working with external data in Flash - MovieClipLoader class


    (Page 4 of 6 )

    The MovieClipLoader Class can be used in lieu of the loadMovie() method.

    This class lets you implement listener call backs that provide status information while SWF or JPEG files are being loaded into movie clips.

    Instead of using loadMovie()or MovieClip.loadMovie() methods, you need to use MovieClipLoader.loadClip() to use the features of the MovieClipLoader class.

    The following events will take place in the order listed when you use MovieClipLoader Class:

    MovieClipLoader.onLoadStart– This event listener will fire when the first bytes of the SWF or JPEG file are downloaded.

    MovieClipLoader.onLoadProgress– This event listener will continuously fire during the loading process, and can be used to show the loading progress to the users. During the load process you can call MovieClipLoader.getProgress()at any time to know the progress of the loading.

    MovieClipLoader.onLoadComplete– This event listener will fire when the entire file has been downloaded.

    MovieClipLoader.onLoadInit– This event listener will fire after the downloaded file’s first frame actions have been executed. This will be helpful for performing any actions on the loaded file. Until this event listener fires, you cannot perform any actions on the loaded file.

    Note: If there is any problem loading the file then MovieClipLoader.onLoadErrorevent listener will fire and return the error code.

    Now let us see an example of how to use the MovieClipLoader class in action. 

    Example:

    // Instantiate MovieClipLoader Class

    var adloader:MovieClipLoader = new MovieClipLoader();

    // use loadClip to load SWF file into a movie clip header_mc

    adloader.loadClip("mainad.swf","header_mc");

    // Add an onLoadStart event listener to show the progress of the loading

    adloader.onLoadStart = function (targetMC){

             var loadProgress:Object = adloader.getProgress(targetMC);

             var loaded:Number = loadProgress.bytesLoaded;

             var total:Number = loadProgress.bytesTotal;

             adprogress_txt.text = loaded+" of "+ total+" bytes loaded";

    }

    // Add an onLoadComplete event listener to clear the loading information

    adloader.onLoadComplete = function (targetMC){

             adprogress_txt.text = "";

    }

    // Add an onLoadError event listener to trace the load errors

    adloader.onLoadError = function (targetMC, errorCode){

             adprogress_txt.text = "ERRORCODE:" + errorCode + " failed to load";

    }   

    More Flash Articles
    More By Adi Reddy Mora


     

    FLASH ARTICLES

    - Critical Flash Vulnerability Heats Up the Web
    - More on Nonpersistent Client-Side Remote Sha...
    - Nonpersistent Client-Side Remote Shared Obje...
    - Using the Decorator Pattern for a Real Web S...
    - Using Concrete Decorator Classes
    - Delving More Deeply into the Decorator Patte...
    - The Decorator Pattern in Action
    - A Simple Decorator Pattern Example
    - 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







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    Stay green...Green IT