Categories

Partners
  • Website Templates

  • Design Feeds

  • Adobe Photoshop Tutorials

  • Website Templates, WordPress Themes

  • Website Templates

  • Flash Web Sites

  • Photoshop Templates

  • Photo Contests

  • Photo Tips
  • Search


    Advanced Search


    Partner Links
  • Adobe Photoshop Tutorials

  • Free Stock Photos and Images



  • Website Templates

    Loading in Images Using the MovieClipLoader Class
    Published  06/19/2006 | Macromedia Flash
       




    Loading in Images Using the MovieClipLoader Class

    Loading in MovieClips (JPEGs or SWFs) is easier than ever now with the MovieClipLoader class. Before, when loading in MovieClips using the MovieClip.loadMovie method the onLoad method wouldn't always work, which meant that you wouldn't always be able to know when exactly the clip you were trying to load had finished loading. Now with the MovieClipLoader class you can track events much easier.

    The following code demonstrates how to create an instance of the MovieClipLoader class, create a listener object which will wait for the JPEG image to finish loading in and finally how to call the loadClip method:

    1. var mclListener:Object = new Object();
    2. mclListener.onLoadInit = function(target_mc:MovieClip) {
    3.     target_mc._rotation = 5;
    4. };
    5. var logo_mcl:MovieClipLoader = new MovieClipLoader();
    6. logo_mcl.addListener(mclListener);
    7. logo_mcl.loadClip("logo.jpg", this.createEmptyMovieClip("logo_mc", this.getNextHighestDepth()));
    Article Series
    This article is part 6 of a 13 part series. Other articles in this series are shown below:
    1. Flash FAQ - Introduction
    2. Streaming FLV files in Flash MX 2004
    3. Creating an XML Packet with Flash - the easy way
    4. Creating an XML Packet with Flash - the hard way
    5. Getting more colors for your Halo
    6. Loading in Images Using the MovieClipLoader Class
    7. Parsing an XML Packet in Flash
    8. Parsing XML in Flash Using the XMLConnector
    9. Sending an XML Packet to a Server-Side Page
    10. Using LoadVars.send Method to Exchange Data with a Server-Side Script
    11. Using the Alert component
    12. Using the LoadVars Class to Load Variables
    13. Using XPath in Flash MX 2004