We Recommend

Introduction to Programming using SML Introduction to Programming using SML
Provides a thorough introduction to the principles of programming and program design using the Standard ML programming language. Emphasis is putting the theory of programming into practice.


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 

You need to login to post a comment.