# Obtaining instance name without \_stage location?

**URL:** <https://forum.kirupa.com/t/obtaining-instance-name-without--stage-location/234795>\
**Category:** flash\
**Created:** [August 6, 2007, 9:28am UTC](https://forum.kirupa.com/t/obtaining-instance-name-without--stage-location/234795 "2007-08-06T09:28:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kingscooty](https://avatars.discourse-cdn.com/v4/letter/k/73ab20/32.png) [@kingscooty](https://forum.kirupa.com/u/kingscooty)\
**Post date:** [August 6, 2007, 9:28am UTC](https://forum.kirupa.com/t/obtaining-instance-name-without--stage-location/234795/1 "2007-08-06T09:28:47Z")

</div>

Oki, i’m generating a few movieclip functions from an array that relate to an mc that’s on the stage. However, in the mc.onRelease function, i can’t seem to get the \_root.filename = \*\*\* .txt to match the name of said mc instance. Instead i get a really long location for the mc on the stage ☹ Any ideas how i can get round this?

```auto

var machines:Array = [unimatic,circularSaw,heatpress,embroidery,lineBender,laser,mugpress,vacuumF,linisher,profileCutter,pillarDrill,novamill,compactRouter];

for(var i:Number = 0; i < machines.length; i++)
{
    var mc:MovieClip = machines*;
    
    mc.onRollOver = function():Void
    {
        this.gotoAndPlay(2);
    }
    
    mc.onRollOut = function():Void
    {
        this.gotoAndStop(1);
    }
    
    mc.onRelease = function():Void
    {    
        _root.attatchTab();
        _root.filename = this + ".txt"; // THIS IS THE DEATH LINE >.<
    }
}

```
