# BitmapData / copyPixels Guidance

**URL:** https://forum.kirupa.com/t/bitmapdata-copypixels-guidance/240813
**Category:** flash
**Created:** [October 6, 2007, 3:53pm UTC](https://forum.kirupa.com/t/bitmapdata-copypixels-guidance/240813 "2007-10-06T15:53:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nickcherryjiggz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nickcherryjiggz/32/2107_2.png) [@nickcherryjiggz](https://forum.kirupa.com/u/nickcherryjiggz)
#### Post date: [October 6, 2007, 3:53pm UTC](https://forum.kirupa.com/t/bitmapdata-copypixels-guidance/240813/1 "2007-10-06T15:53:17Z")

</div>

After seeing the [I’ve been told that movieclips aren’t suited for games, what do you use?](http://www.kirupa.com/forum/showthread.php?t=276114) thread, I thought I would try to incorporate the approach into a game I’m currently programming to make it a little less processor intensive.

I have a giant movieclip of a football field, of which only 5-10% is shown at any given time. I’m guessing that flash still has to make calculations for the other 90-95% of the field every frame, even though it’s of no use. From what I understand (not much), copyPixels seems like the perfect candidate for such a situation.

It seems simple, but I’m having trouble actually implementing it, and I’m not sure which actions are needed and what might be introducing unnecessary work. I have a movieclip (mc\_field, exported for as), but if it would save the processor some effort, I could easily save this as a bitmap and export that for actionscript. The width and height of the final product (bitmap/BitmapData) will be Stage.width, Stage.height, respectively, and I can handle making the calculations of the x,y coordinates of the rectangle cropping (which part of the source bitmap I want to crop). I would be very thankful, though, if someone could just show me how I should do this. I’m sure it’s only 3 lines of code, and I know that there are a few examples online, but for some reason, I’m having difficulty following them (I think they may be a little more complicated than what I need).

Say, for frame one, I want to take the field (either mc\_field or bm\_field) and copy 500px x 300px, starting at 140,230 from the source bitmap to mc\_container.

Then, for frame two, I want to copy 500px x 300px starting at 240,540 from the source bitmap to mc\_container.

If someone could show me how to do this, I would be very grateful.
