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
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);
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
Related Post
Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.












































Comments
No comments yet.
Leave a comment