# Setting movieclips from library

**URL:** <https://forum.kirupa.com/t/setting-movieclips-from-library/325753>\
**Category:** Uncategorized\
**Created:** [November 3, 2011, 12:00am UTC](https://forum.kirupa.com/t/setting-movieclips-from-library/325753 "2011-11-03T00:00:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phastings](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@phastings](https://forum.kirupa.com/u/phastings)\
**Post date:** [November 3, 2011, 12:00am UTC](https://forum.kirupa.com/t/setting-movieclips-from-library/325753/1 "2011-11-03T00:00:10Z")

</div>

i have three movieclips in my library(Ground1, Ground2, Ground3).

depending on the game level i want to use a different one but i reference the ground movieclip through out the game. how can i declair the variable(ie  
var ground:Ground1;) so i can set ground to a different library clip like this:

if(level == 1){  
ground = new Ground1();  
}  
if(level == 2){  
ground = new Ground2();  
}  
if(level == 3){  
ground = new Ground1();  
}  
ground.scaleX = 10;  
ground.scaleY = 10;  
worldSprite.addChild(ground);
