Posted By

chrisaiv on 01/30/08


Tagged

MovieClipLoader as2


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Wiederkehr
ninedaysoff


AS2: Basic MovieClipLoader example


 / Published in: ActionScript
 

Best way to load .SWF, .JPG, .GIF

  1. //1. load an external movie clip that creates different events to respond to
  2. var mcl:MovieClipLoader = new MovieClipLoader();
  3. //2. MovieClip Loader Event Listenter
  4. var mclL:Object = new Object();
  5. //3. Loader
  6. mclL.onLoadProgress = function(target, loadedBytes, totalBytes) {
  7. // trace(Math.round((loadedBytes / totalBytes) * 100) + "%");
  8. };
  9. //4. SWF has been fully downloaded + AS on frame 1 have been executed
  10. mclL.onLoadInit = function(info) {
  11. trace(info);
  12. };
  13. //5. Register to recieve events
  14. mcl.addListener(mclL);
  15. //6. Load either a SWF or JPG (Fight on!)
  16. mcl.loadClip("http://www.usc.edu/identity/private/images/index/5900_2.img");

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: bharathabk on January 12, 2011

thanks

Posted By: bharathabk on January 12, 2011

//1. load an external movie clip that creates different events to respond to var mcl:MovieClipLoader = new MovieClipLoader(); //2. MovieClip Loader Event Listenter var mclL:Object = new Object(); //3. Loader mclL.onLoadProgress = function(target, loadedBytes, totalBytes) { // trace(Math.round((loadedBytes / totalBytes) * 100) + "%"); }; //4. SWF has been fully downloaded + AS on frame 1 have been executed mclL.onLoadInit = function(info) { trace(info); }; //5. Register to recieve events mcl.addListener(mclL); //6. Load either a SWF or JPG (Fight on!) mcl.loadClip("http://www.usc.edu/identity/private/images/index/5900_2.img",mcl);

You need to login to post a comment.