# Scale an added sprite when resizing an AIR window

**URL:** <https://forum.kirupa.com/t/scale-an-added-sprite-when-resizing-an-air-window/296295>\
**Category:** Uncategorized\
**Created:** [September 12, 2009, 7:32pm UTC](https://forum.kirupa.com/t/scale-an-added-sprite-when-resizing-an-air-window/296295 "2009-09-12T19:32:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![noverflow](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@noverflow](https://forum.kirupa.com/u/noverflow)\
**Post date:** [September 12, 2009, 7:32pm UTC](https://forum.kirupa.com/t/scale-an-added-sprite-when-resizing-an-air-window/296295/1 "2009-09-12T19:32:30Z")

</div>

I have an AIR app who has a canvas that scales when I resize the window. I have a sprite that is added to that canvas. When I scale the window the sprite does not scale with it.

How do I tell the added sprite to scale with the canvas? Or tell it to be 100% of the container always?

Right now I am listening for a resize event and resizing the sprite on that. But that seems like a waste of code/ too much of a CPU hog because I can easily add an element (using MXML) and tell it to be 100% of the parent and it will scale it on its own (EG without telling it to).
