class Keys { private var _height:Number = 0; public var left:Number = 0; public var top:Number = 0; private var count:Number = 0; private var key_mcs:Array; function Keys( left:Number, top:Number, styles:Array ) { this.left = left; this.top = top; this.key_mcs = Array(); var key:Number = 0; for( var i=0; i 0) and (styles[i].key != '' ) ) { this.key_mcs.push( this.make_key( styles[i], key ) ); key++; } } this.count = key; this.move(); } // // this should be in the destructor, but // actionscript does not support them :-( // function del() { for( var i=0; i Stage.width ) { // it is past the edge of the stage, so move it down a line x = left; top += this.key_mcs[i]._height; height += this.key_mcs[i]._height; } this.key_mcs[i]._x = x; this.key_mcs[i]._y = top; // move next key to the left + some padding between keys x += width + 10; } // Ugly code: height += this.key_mcs[0]._height; this._height = height; } function height() { return this._height; } }