stretching image to size of browser using BitmapData class and dawing api


ive been working great tutorial found @ http://www.gotoandlearn.com/download.php on creating full browser flash. uses bitmapdata class , drawing api attach image stage , have image tile when browser window resized. problem want image stretch fit browser window instead of tile.

i've looked alternatives on attaching image movieclip , having mc resize, thats no since i'm using drawing api draw other elements on background. movieclip covers other elements.

any ideas?

import flash.display.bitmapdata;

var bgimage:bitmapdata = bitmapdata.loadbitmap("bgimage");

function fillbg() {
this.beginbitmapfill(bgimage);
this.moveto (0,0);
this.lineto (stage.width,0);
this.lineto (stage.width, stage.height);
this.lineto (0, stage.height);
this.lineto (0,0);
this.endfill ();

}

fillbg();

var stagelisten:object = new object();
stagelisten.onresize = function() {
fillbg();
}

stage.addlistener(stagelisten);

is background want scale or in flash want scale?


More discussions in ActionScript 1 and 2


adobe

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums