# Filling movie clip with pattern

**URL:** <https://forum.kirupa.com/t/filling-movie-clip-with-pattern/201667>\
**Category:** flash\
**Created:** [September 23, 2006, 7:51pm UTC](https://forum.kirupa.com/t/filling-movie-clip-with-pattern/201667 "2006-09-23T19:51:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![psych](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/psych/32/2839_2.png) [@psych](https://forum.kirupa.com/u/psych)\
**Post date:** [September 23, 2006, 7:51pm UTC](https://forum.kirupa.com/t/filling-movie-clip-with-pattern/201667/1 "2006-09-23T19:51:17Z")

</div>

What i’m trying to do is : dynamically create an mc and fill it with pattern from library and then slide that mc a little bit using mc\_tween but it doesn’t work so i will appreciate some help. That mc with pattern is used like a background and will be bigger than stage so with sliding it a little bit i am infact trying to create shake effect on the background. This is my basic code, pattern is displayed but sliding doesn’t work and I think the problem is that i can’t fill mc with pattern this way so mc stays empty and can’t be tweened (that’s my guess) but i can’t find solution:

```auto
#include "mc_tween2.as" 
import flash.display.*; 
 
var bg:BitmapData = BitmapData.loadBitmap("pattern"); 
this.createEmptyMovieClip("back_mc",this.getNextHighestDepth()); 
 
function fillBG(){ 
   with(back_mc){ 
   this.beginBitmapFill(bg); 
   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(); 
 
back_mc.ySlideTo(back_mc._y+100,3);

```

And .fla is [HERE](http://download.yousendit.com/16AA6E1673428FEE)!

Thanks a lot
