# Targetting a mc

**URL:** https://forum.kirupa.com/t/targetting-a-mc/289184
**Category:** Uncategorized
**Created:** [May 27, 2009, 10:26am UTC](https://forum.kirupa.com/t/targetting-a-mc/289184 "2009-05-27T10:26:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![maxelcat](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/maxelcat/32/2854_2.png) [@maxelcat](https://forum.kirupa.com/u/maxelcat)
#### Post date: [May 27, 2009, 10:26am UTC](https://forum.kirupa.com/t/targetting-a-mc/289184/1 "2009-05-27T10:26:00Z")

</div>

I have a list of links generated from xml using AS3

```auto

function createVideoLinks():void{
 for (var i:int=0; i<externalXML.videoClip.length();i++){
 vidText*=externalXML.videoClip.vTitle*;
 vidLink*=externalXML.videoClip*.@vurl;
 
 var linkHolder:MovieClip = new MovieClip();
 var linkText:TextField = new TextField();
 linkHolder.addChild(linkText);
 addChild(linkHolder);
 linkHolder.buttonMode=true; //appears to give me back the correct cursor for links
 linkHolder.ref=i;
 linkHolder.mouseChildren = false;
 linkHolder.addEventListener(MouseEvent.CLICK, clickHandler);
 linkHolder.addEventListener(MouseEvent.MOUSE_OVER, overHandler);
  }
}

```

This all works well. When I click on a link I can use

```auto
trace ("you are in overHandler="+event.target.ref);

```

to get the ref number for each link, and so get the link etc etc

WHat I also want to do is change the foramtting of the link when its rollovered/pressed

WHen I roll over I can get the ref number - but how do I target the link I just rolled over

I suppose what I am really asking is in AS2 I would have done something like  
createNewMovieCLip (“name”+i…) to give it a unique id and then targetted that.

What’s the as3 equivilent

thanks
