home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / midnightstrike1.swf / scripts / __Packages / com / neodelight / std / Canvas.as < prev    next >
Encoding:
Text File  |  2007-04-02  |  1.2 KB  |  50 lines

  1. class com.neodelight.std.Canvas
  2. {
  3.    var mc;
  4.    static var lib = new Array();
  5.    function Canvas(mc, id)
  6.    {
  7.       this.mc = mc;
  8.       this.mc.canvas = this;
  9.       if(int(this.mc.canvasNextId) == 0)
  10.       {
  11.          this.mc.nextId = 1;
  12.       }
  13.       if(id)
  14.       {
  15.          com.neodelight.std.Canvas.lib[id] = this;
  16.       }
  17.    }
  18.    static function getCanvas(mc, id)
  19.    {
  20.       if(mc.canvas)
  21.       {
  22.          return mc.canvas;
  23.       }
  24.       return new com.neodelight.std.Canvas(mc,id);
  25.    }
  26.    static function getCanvasById(id)
  27.    {
  28.       return com.neodelight.std.Canvas.lib[id];
  29.    }
  30.    function attachMovie(idName, initObject)
  31.    {
  32.       this.mc.canvasNextId = int(this.mc.getNextHighestDepth());
  33.       return this.mc.attachMovie(idName,"mc" + this.mc.canvasNextId,this.mc.canvasNextId++,initObject);
  34.    }
  35.    function createEmptyMovieClip()
  36.    {
  37.       this.mc.canvasNextId = int(this.mc.getNextHighestDepth());
  38.       return this.mc.createEmptyMovieClip("mc" + this.mc.canvasNextId,this.mc.canvasNextId++);
  39.    }
  40.    function reset()
  41.    {
  42.       this.mc.clear();
  43.       this.mc.canvasNextId = 1;
  44.    }
  45.    function toString()
  46.    {
  47.       return "[Canvas of " + this.mc._target + "]";
  48.    }
  49. }
  50.