# Get the object name out of the function variable

**URL:** <https://forum.kirupa.com/t/get-the-object-name-out-of-the-function-variable/325359>\
**Category:** Uncategorized\
**Created:** [October 11, 2011, 10:49am UTC](https://forum.kirupa.com/t/get-the-object-name-out-of-the-function-variable/325359 "2011-10-11T10:49:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeeto](https://avatars.discourse-cdn.com/v4/letter/z/e274bd/32.png) [@zeeto](https://forum.kirupa.com/u/zeeto)\
**Post date:** [October 11, 2011, 10:49am UTC](https://forum.kirupa.com/t/get-the-object-name-out-of-the-function-variable/325359/1 "2011-10-11T10:49:47Z")

</div>

Hi guys,

How can I get the name out of the passed variable to the function?

for example:

```auto
drawArea(auto); //auto is a MovieClip();

private function drawArea(m:MovieClip):void {
   
   m.graphics.beginFill(0xFF0000, 0.1);
   m.graphics.drawRect(0, 0, stage.stageWidth / 3, stage.stageHeight);
   m.graphics.endFill();
   
   addChild(m);

[COLOR=#FF0000]// how to get the tracer to output: "auto"[/COLOR]

   m.buttonMode = true;
   m.addEventListener(MouseEvent.CLICK, clicked);
}

```
