home *** CD-ROM | disk | FTP | other *** search
- class com.neodelight.std.Canvas
- {
- var mc;
- static var lib = new Array();
- function Canvas(mc, id)
- {
- this.mc = mc;
- this.mc.canvas = this;
- if(int(this.mc.canvasNextId) == 0)
- {
- this.mc.nextId = 1;
- }
- if(id)
- {
- com.neodelight.std.Canvas.lib[id] = this;
- }
- }
- static function getCanvas(mc, id)
- {
- if(mc.canvas)
- {
- return mc.canvas;
- }
- return new com.neodelight.std.Canvas(mc,id);
- }
- static function getCanvasById(id)
- {
- return com.neodelight.std.Canvas.lib[id];
- }
- function attachMovie(idName, initObject)
- {
- this.mc.canvasNextId = int(this.mc.getNextHighestDepth());
- return this.mc.attachMovie(idName,"mc" + this.mc.canvasNextId,this.mc.canvasNextId++,initObject);
- }
- function createEmptyMovieClip()
- {
- this.mc.canvasNextId = int(this.mc.getNextHighestDepth());
- return this.mc.createEmptyMovieClip("mc" + this.mc.canvasNextId,this.mc.canvasNextId++);
- }
- function reset()
- {
- this.mc.clear();
- this.mc.canvasNextId = 1;
- }
- function toString()
- {
- return "[Canvas of " + this.mc._target + "]";
- }
- }
-