-
[F8] Actionscript 2 - Background Issue
Hello everyone,
I am using this code to tile a background image:
Code:
import flash.display.BitmapData;
polaroid._x = Stage.width / 2;
polaroid._y = Stage.height / 2;
var tile:BitmapData = BitmapData.loadBitmap("tile");
function fillBG() {
this.beginBitmapFill(tile);
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 stageL:Object = new Object();
stageL.onResize = function() {
fillBG();
polaroid._x = Stage.width / 2;
polaroid._y = Stage.height / 2;
}
Stage.addListener(stageL);
This works fine.. but what if I didn't want to tile the image but stretch it to fill the entire stage? Can anyone help please?
Thanks in advance,
Luke
-
I have the exact same question.... What's the actionscript for tiling a background image "endlessly"?
So if the flash is published at 100% x 100%, the background image will continue to tile and fill the screen.
Thanks.....
-
dustar...
the code I originally posted does just that!! All you have to do is import an image to your library and export it for actionscript with the identifier "tile".
What I am looking for is something different... I want the image to not be tiled but stretched accordingly to fill the entire browser
-
image._width = Stage.width;
image._height = Stage.height;
if you publish at 100% with margins at 0, the Stage will fill up the browser.
More info on the Stage (listeners and onResize()) in the liveDocs (link in my footer)
gparis
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|