Simple TileBG class
Posted: June 5th, 2008 | Author: John del Rosario | Filed under: AS 3.0 | Tags: ActionScript, AS3, Classes, Flash | No Comments »Here is another class I made for my site… It’s nothing fancy, and in fact it could easily be done without this class, but basically, this class creates a rectangular object and fills it with an image from an outside source, tiles it, and you could easily adjust the width and height of the object, and load a new pattern.
Usage:
import com.mindfock.display.TiledBG; //import class
...
tiledBG = new TiledBG("path/to/pattern.gif", 800, 600);
addChild(tiledBG);
tiledBG.tileWidth = 500 // change width
tiledBG.tileHeight = 500 // change height
tiledBG.newPattern("path/to/new/pattern.gif"); //changing pattern image
Leave a Reply