Posted By

IsoJon on 08/04/10


Tagged

loading


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

PixelJuice


Simple little loader utility


 / Published in: ActionScript 3
 

When you just need something small and simple.

  1. initLoad();
  2.  
  3. function initLoad() : void
  4. {
  5. var contentLoader : Loader = new Loader();
  6. var s : Sprite = new Sprite();
  7. var link : String = "http://isokon.net/post/cloudvcloud.jpg";
  8.  
  9. // here we are adding the child of what the utility returns
  10. s.addChild( load( link, contentLoader ));
  11. addChild(s);
  12. }
  13.  
  14. // the loading utility
  15. function load( url:String, l:Loader ) : Loader {
  16. l.load( new URLRequest( url ) );
  17. return l;
  18. }

Report this snippet  

You need to login to post a comment.