//------------------------------------- // 99 Bottles in object oriented actionscript // 11/2002 by Ralf Bokelberg - helpQLODhelp.de //------------------------------------- //------------------------------------- // The Baseclass for the drinks //------------------------------------- function PackageClass(name, content){ this.name = name; this.content = content; } // PackageClass.prototype.display = function(nr){ if(nr > 1) return nr + " " + this.name + "s of " + this.content; else if(nr == 1) return "1 " + this.name + " of " + this.content; else return "no more " + this.name + "s of " + this.content; } //------------------------------------- // The class for bottles of beer // inherits from PackageClass //------------------------------------- function BottleOfBeerClass(){} // BottleOfBeerClass.prototype = new PackageClass("bottle", "beer"); //------------------------------------- // The WallClass to hold our bottles //------------------------------------- function WallClass(packageClass){ this.storage = []; this.packageClass = packageClass; } // WallClass.prototype.addPackages = function(count){ for(var i=0; i 0); // trace(result);