# AddChild, Sprite & Size

**URL:** <https://forum.kirupa.com/t/addchild-sprite-size/319343>\
**Category:** flash\
**Created:** [February 17, 2011, 1:14am UTC](https://forum.kirupa.com/t/addchild-sprite-size/319343 "2011-02-17T01:14:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![selacius](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@selacius](https://forum.kirupa.com/u/selacius)\
**Post date:** [February 17, 2011, 1:14am UTC](https://forum.kirupa.com/t/addchild-sprite-size/319343/1 "2011-02-17T01:14:16Z")

</div>

I am working on an RPG game which follows the concept that originates from the Foundation Game Design With Flash. I have created the global game manager and am working on adding scrolling to the game. To accommodate my method for changing maps, I have added a container sprite which includes the map movieclip, and then I add the player to the stage on top of the container. This way when I use removechild and addchild to swap maps, the player remains on top of the stage.

This is how it is setup now:

```auto
var container:Sprite = new Sprite();
var player:Player;
var CurrDngn = new DungeonThree_Manager();

this.addchild(container);
container.addchild(CurrDngn);
this.addchild(player);

```

Now, my issue arises because with my scrolling I want to make the container a set height and width, which may sometimes be smaller than the map (CurrDngn) object. What I want to do in this place is to only have the portion which fits into the container object to be displayed.
