# Instance names

**URL:** https://forum.kirupa.com/t/instance-names/16561
**Category:** Uncategorized
**Created:** [March 26, 2003, 6:01am UTC](https://forum.kirupa.com/t/instance-names/16561 "2003-03-26T06:01:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Lacuna](https://avatars.discourse-cdn.com/v4/letter/l/edb3f5/32.png) [@Lacuna](https://forum.kirupa.com/u/Lacuna)
#### Post date: [March 26, 2003, 6:01am UTC](https://forum.kirupa.com/t/instance-names/16561/1 "2003-03-26T06:01:15Z")

</div>

Hello.

I am currently building a menu (which i unfortunately can’t paste the fla here) and was wondering if someone could give me a little advice. I have it set up that the movie will duplicate itself upon loading and therefore I can’t select the multiple graphics while designing in flash because they technically dont exist yet…

What I need to know is how can I refer to “instance names” in a/s and tell it to load a specific movie on press/release on that instances graphic? It might be very simple but I can’t seem to find the answer.

Please let me know if I’m not making myself clear and I might have to try to post my fla later then. Thank you very much.

Thanks.

:love:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 26, 2003, 6:05am UTC](https://forum.kirupa.com/t/instance-names/16561/2 "2003-03-26T06:05:33Z")

</div>

are you trying to do something like this?

```auto
this[myVar].onPress = function() { } 

```

…where the instance name goes in ‘myVar’? 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 26, 2003, 6:22am UTC](https://forum.kirupa.com/t/instance-names/16561/3 "2003-03-26T06:22:56Z")

</div>

that isn’t doing it… its saying

```php

Frame=1: Line 17: Statement must appear within on/onClipEvent handler
     this[menu0].onPress = function() {

```

and so i add

```php

onClipEvent (enterFrame) {
this[menu0].onPress = function() {
	loadMovieNum("menu.swf", _level10);
}}

```

and it runs without errors until i click a button and then i get something that says

```php

name: menu0
buttontext: Main

```

Because there’s a line in the a/s that says

```php

MovieClip.prototype.DoSomething = function (theClip) { trace ("name: "+theClip._name);trace ("type: "+theClip.mov.txt);};

```

so i figure if i could even take the ‘dosomething’ or the ‘theClip.mov.txt’ then i should be able to assign different actions to the different variables… am i talking jibberish here???
