# Passing mc by reference into a draw() method

**URL:** https://forum.kirupa.com/t/passing-mc-by-reference-into-a-draw-method/253070
**Category:** Uncategorized
**Created:** [February 26, 2008, 10:29pm UTC](https://forum.kirupa.com/t/passing-mc-by-reference-into-a-draw-method/253070 "2008-02-26T22:29:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pixel\_streamer](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@pixel\_streamer](https://forum.kirupa.com/u/pixel_streamer)
#### Post date: [February 26, 2008, 10:29pm UTC](https://forum.kirupa.com/t/passing-mc-by-reference-into-a-draw-method/253070/1 "2008-02-26T22:29:20Z")

</div>

```auto

var bitmapMC:BitmapData = new BitmapData(SW, SH, true, 0xFFFFFFFF);
var mcreference:MovieClip = holder[holdername];
bitmapMC.draw([mcreference]);

```

I’m trying to pass an mc by array reference into a BitmapData.draw method.

The code above seems to work only when I replace the [mcreference] with a movieclip that is on the stage; holder.holder\_mc1 for example.

Am I not passing/typing the variable correctly, or is this a bug in Flash 8? (Currently, the mcreference “variable” is typed as an MC.)

Thanks for any help!
