AS3 fullsize background image with pixel pattern

I have written a small class which I think some of you really would like to use.  With this class you can create a fullsize background image which fits to the width of the stage. The height of the image is proportional to the width. So it´s good to use an image with a ratio of 4:3 otherwise empty bars can show up.

To round it up I create a pixel pattern overlay so the image quality is acceptable by streching it. Known from other sites…

Downloadget the sourceDemosee an example

So thats the way to do it:

// import the class
import com.fullsizeBackgroundImage.fullsizeBackgroundImage;

// create a new object, give the url to the image as string
var backgroundImage:fullsizeBackgroundImage = new fullsizeBackgroundImage("images/background.jpg");

// add the object to stage
stage.addChild(backgroundImage);

If you have any question about the script feel free to leave a comment :)


Leave a Reply