# Refering to Instance Name

**URL:** https://forum.kirupa.com/t/refering-to-instance-name/183954
**Category:** Uncategorized
**Created:** [March 31, 2006, 1:55pm UTC](https://forum.kirupa.com/t/refering-to-instance-name/183954 "2006-03-31T13:55:23Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![martinb18](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@martinb18](https://forum.kirupa.com/u/martinb18)
#### Post date: [March 31, 2006, 1:55pm UTC](https://forum.kirupa.com/t/refering-to-instance-name/183954/1 "2006-03-31T13:55:23Z")

</div>

im trying to, to make my MC have a rollover effect but my movie clip had been added by Action Script so this doesnt work

pane.onRollOver = over;  
pane.onRollOut = out;

function over() {  
this.gotoAndPlay(2);  
}  
function out() {  
this.gotoAndPlay(7);  
}

or can you refer by linkage ID?

---

<div class="post-metadata">

### Author: ![Pascal\_S](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@Pascal\_S](https://forum.kirupa.com/u/Pascal_S)
#### Post date: [March 31, 2006, 2:10pm UTC](https://forum.kirupa.com/t/refering-to-instance-name/183954/2 "2006-03-31T14:10:50Z")

</div>

come again?

your Mc has been added with AS and you cant give it an rollover effect why not??

---

<div class="post-metadata">

### Author: ![martinb18](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@martinb18](https://forum.kirupa.com/u/martinb18)
#### Post date: [March 31, 2006, 2:17pm UTC](https://forum.kirupa.com/t/refering-to-instance-name/183954/3 "2006-03-31T14:17:11Z")

</div>

> [@Pascal S.](#):
>
> come again?
> 
> your Mc has been added with AS and you cant give it an rollover effect why not??

im mean, how can i give it an instance name because as its not on the timeline but in the libary it doesnt let me give it an instance name

---

<div class="post-metadata">

### Author: ![Pascal\_S](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@Pascal\_S](https://forum.kirupa.com/u/Pascal_S)
#### Post date: [April 1, 2006, 3:06pm UTC](https://forum.kirupa.com/t/refering-to-instance-name/183954/4 "2006-04-01T15:06:57Z")

</div>

pls post your files or some more code…

---

<div class="post-metadata">

### Author: ![gvozden](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/gvozden/32/1084_2.png) [@gvozden](https://forum.kirupa.com/u/gvozden)
#### Post date: [April 1, 2006, 3:44pm UTC](https://forum.kirupa.com/t/refering-to-instance-name/183954/5 "2006-04-01T15:44:35Z")

</div>

you must use attachMovie for movies from library so you can reference them in ActionScript code

---

<div class="post-metadata">

### Author: ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)
#### Post date: [April 2, 2006, 2:28am UTC](https://forum.kirupa.com/t/refering-to-instance-name/183954/6 "2006-04-02T02:28:09Z")

</div>

When you call MovieClip.attachMovie you must make a name for it.

```auto
attachMovie(idName:String, newName:String, depth:Number):MovieClip
//idName - the linkage identifier of the movie clip in the library
//newName - the name for the movie clip once it is attached to the stage, this is the instance name of the movie clip
//depth - the depth to attach the movie clip at

```

Things like this is what the help file was made for 😉
