Guest User

Untitled

a guest
Oct 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. Namespace.Register("DeepElement.ThreeOneFour.Component")
  2.  
  3. /*
  4. * Represents a Javascript Component Baseclass that supports async
  5. * loading/unloading
  6. *
  7. */
  8. DeepElement.ThreeOneFour.Component = new Class({
  9. Implements: Events,
  10.  
  11. loaded: false,
  12.  
  13. initialize: function() {},
  14.  
  15. load: function(success, failure) {
  16. if (!this.loaded) {
  17. this.loaded = true;
  18. if (success != null) success();
  19. }
  20. },
  21.  
  22. unload: function(success, failure) {
  23. if (this.loaded) {
  24. this.loaded = false;
  25. if (success != null) success();
  26. }
  27. },
  28.  
  29. getLoaded: function() {
  30. return this.loaded;
  31. }
  32. });​
Add Comment
Please, Sign In to add comment