Copy link to clipboard
Copied
Hi Eone,
i'm trying to create a full stage site. I do use this code:
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeListener);
function resizeListener (e:Event):void {
trace("stageWidth: " + stage.stageWidth + " stageHeight: " + stage.stageHeight);
bG.width = stage.stageWidth; //mc which contains the bg image
bG.height = stage.stageHeight;
but it doesn't work . No error, no warnings. So i don't know what is the problem. It works only in the flash player (Ctrl+Enter), maybe the HTML is wrong?
1 Correct answer
If it works properly in the Flash IDE, it's likely a problem with the embedding html. Did you set the width and height in the html to 100%?

Copy link to clipboard
Copied
When are you applying this?
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeListener);
Are you sure that "stage" is available when you set these properties and the listener? The "stage" property can be tricky...
Copy link to clipboard
Copied
If it works properly in the Flash IDE, it's likely a problem with the embedding html. Did you set the width and height in the html to 100%?
Copy link to clipboard
Copied
I had already done. Thank you anyway anyone
Copy link to clipboard
Copied
Looks like you're close. Try this example:
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
var bmp:Tile = new Tile(35, 35);
var tile:BitmapData = new BitmapData(35, 35);
tile.draw(bmp);
function fillBG(evt:Event = null):void {
graphics.beginBitmapFill(tile);
graphics.moveTo(0, 0);
graphics.lineTo(stage.stageWidth, 0);
graphics.lineTo(stage.stageWidth, stage.stageHeight);
graphics.lineTo(0, stage.stageHeight);
graphics.lineTo(0, 0);
graphics.endFill();
};
fillBG();
stage.addEventListener(Event.RESIZE, fillBG);
This example draws a rectangle the size of the stage and fills it with with a little 35px by 35px bitmap image I think it was a jpg it could have just as well been a gif. (and of course you could just fill with a color) .that was converted to a symbol and given the Class name Tile. In the publish settings in the HTML tab be sure to set dimensions to percent 100 100. In the html set this css rule body {margin:0; padding:0; overflow:auto;}

