MovieClipLoader.hx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package flash;
  2. #if flash_strict
  3. typedef MclListener = {
  4. function onLoadInit(target:MovieClip) : Void;
  5. function onLoadStart(target:MovieClip) : Void;
  6. function onLoadProgress(target:MovieClip, loaded : Int, total : Int) : Void;
  7. function onLoadComplete(target:MovieClip, httpStatus : Int) : Void;
  8. function onLoadError(target:MovieClip, error:String, httpStatus : Int) : Void;
  9. }
  10. #end
  11. extern class MovieClipLoader
  12. {
  13. // don't allow target : String
  14. // and target : Int (_levelX ?)
  15. function new() : Void;
  16. function getProgress(target:MovieClip): { bytesLoaded : Int, bytesTotal : Int };
  17. function loadClip(url:String, target:MovieClip):Bool;
  18. function unloadClip(target:MovieClip):Bool;
  19. dynamic function onLoadInit(target:MovieClip) : Void;
  20. dynamic function onLoadStart(target:MovieClip) : Void;
  21. dynamic function onLoadProgress(target:MovieClip, loaded : Int, total : Int) : Void;
  22. dynamic function onLoadComplete(target:MovieClip) : Void;
  23. dynamic function onLoadError(target:MovieClip, error:String) : Void;
  24. #if flash_strict
  25. function addListener(listener:MclListener):Bool;
  26. function removeListener(listener:MclListener):Bool;
  27. #else
  28. function addListener(listener:Dynamic):Bool;
  29. function removeListener(listener:Dynamic):Bool;
  30. #end
  31. /** in FP 9 **/
  32. var checkPolicyFile : Bool;
  33. private static function __init__() : Void untyped {
  34. flash.MovieClipLoader = _global["MovieClipLoader"];
  35. }
  36. }