# Calling movieclip by id in a unique way?

**URL:** <https://forum.kirupa.com/t/calling-movieclip-by-id-in-a-unique-way/289911>\
**Category:** flash\
**Created:** [June 6, 2009, 9:31pm UTC](https://forum.kirupa.com/t/calling-movieclip-by-id-in-a-unique-way/289911 "2009-06-06T21:31:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![atokatim](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@atokatim](https://forum.kirupa.com/u/atokatim)\
**Post date:** [June 6, 2009, 9:31pm UTC](https://forum.kirupa.com/t/calling-movieclip-by-id-in-a-unique-way/289911/1 "2009-06-06T21:31:23Z")

</div>

I am trying to make a multiplayer card game which has 6 players. Each player can hold 2 cards.

The movie clip names are :  
p1c1 // Player 1 card 1  
p1c2 // Player 1 card 2  
p2c1 // Player 2 card 1  
p2c2 // Player 2 card 2  
etc…

I am attempting to make a function that loads the cards into the player’s hand but I can’t figure out how to do this.

Here is what i have so far. It does not work ☹

```auto
import flash.display.BitmapData;

function place_card(whichone, player, cardnum){
    var linkageId:String = whichone;
    var myBitmapData:BitmapData = BitmapData.loadBitmap(linkageId);
    var where = this.("p" + player + "c" + cardnum);
    trace (where);
    var mc:MovieClip = where;
    mc.attachBitmap(myBitmapData, this.getNextHighestDepth());
}

place_card("s7", 2, 2); // This should place the 7 of spades into player 2's card 2 slot

```

Any help is appreciated!
