# Repeating Image, on bottom only - With resizable stage

**URL:** <https://forum.kirupa.com/t/repeating-image-on-bottom-only-with-resizable-stage/313989>\
**Category:** flash\
**Created:** [September 15, 2010, 3:09pm UTC](https://forum.kirupa.com/t/repeating-image-on-bottom-only-with-resizable-stage/313989 "2010-09-15T15:09:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![starr\_stealer](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@starr\_stealer](https://forum.kirupa.com/u/starr_stealer)\
**Post date:** [September 15, 2010, 3:09pm UTC](https://forum.kirupa.com/t/repeating-image-on-bottom-only-with-resizable-stage/313989/1 "2010-09-15T15:09:42Z")

</div>

I am working on a website coming soon landing page that will be entirely flash. I have design a flash file to be resizable and set not to scale or skew any of the objects. Now I am working on a image I want to span across the bottom of the stage. Currently I am attempting this effect by using a tiling bitmap. It kinda works, I have it on the bottom of the stage only, and its only the size of the image. BUT its tiling very strangely, and I tried to clear the sprite on every resize.

I have attached and image showing what I am attempting to fix. Below is my code.

```auto

import flash.events.Event;
import flash.display.Sprite;

var town:Buildings = new Buildings(0, 0);
var bgSprite:Sprite = new Sprite();

function updateSize(e:Event)
{
    bgRectang.width = stage.stageWidth;
    bgRectang.height = stage.stageHeight;

    monsterRectang.x = stage.stageWidth/2 - monsterRectang.width/2;
    monsterRectang.y = stage.stageHeight/2 - monsterRectang.height/2;

    bgSprite.graphics.clear();
    bgSprite.graphics.beginBitmapFill(town);
    bgSprite.graphics.drawRect(0, stage.stageHeight - town.height, stage.stageWidth, town.height);
    bgSprite.graphics.endFill();
}

function init()
{
    addChildAt(bgSprite, bgRectang.z + 1);

    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;

    stage.addEventListener(Event.RESIZE, updateSize);
    stage.dispatchEvent(new Event(Event.RESIZE));

    bgRectang.x = 0;
    bgRectang.y = 0;
}

init();

stop();

```
