Loading External JPEG Image/SWF using MovieClipLoader in Flash 8/Flash MX 2004

MovieClipLoader Class provides you with a rich set of methods that allows you to load an external JPG image/swf on a MovieClip.

Below is the typical code that you will write for loading image/swf. To know more on the MovieClipLoader Class Click Here

Your email:

 


Example:

var mcl = new MovieClipLoader();
mymcl = new Object();
 
mymcl.onLoadProgress = function ()
{
trace("Current Progress");
}
 
mymcl.onLoadComplete = function ()
{
trace("Successful Loaded the Image");
}
 
mymcl.onLoadInit = function ()
{
trace("Begin Loading Image");
}
 
mymcl.onLoadError = function (target_mc, errorCode)
{
trace("ERROR LOADING IMAGE");
}
 
mcl.addListener(mymcl);
mcl.loadClip("Sunset.JPG",movieclip name);

Your email:

 


Explanation:

  • Here i am creating a new moviecliploader instance by name mcl
  • A new event listener for the moviecliploader is also created by name mymcl
  • Now using loadClip method i am loading Sunset.jpg file
  • Defined various event handler function where you can write your functionality after loading the image/swf file, show error message in case for any error

Custom Search


Popular Articles:

  1. Vishwa
    March 18th, 2009 at 02:09 | #1

    It helped a lot. Thanks!

  2. nb
    June 10th, 2009 at 10:04 | #2

    Thanks much appreciated

  1. No trackbacks yet.