# Attaching and retrieveing data with instance names?

**URL:** <https://forum.kirupa.com/t/attaching-and-retrieveing-data-with-instance-names/288299>\
**Category:** flash\
**Created:** [May 13, 2009, 8:45pm UTC](https://forum.kirupa.com/t/attaching-and-retrieveing-data-with-instance-names/288299 "2009-05-13T20:45:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![staffanestberg](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@staffanestberg](https://forum.kirupa.com/u/staffanestberg)\
**Post date:** [May 13, 2009, 8:45pm UTC](https://forum.kirupa.com/t/attaching-and-retrieveing-data-with-instance-names/288299/1 "2009-05-13T20:45:16Z")

</div>

Hi,

My first post here at Kirupa! I’m quite new to AS3 so please bare with me 🙂

I’m developing an AS3 module where the user interacts with certain hardware. One part is highlighting the hardware’s features when the user hovers certain points on it. There’s quite a lot of work to be done here (about 6 modules with about 30 highlights each) so I figured I would make it as changeable as possible.

On the stage I’ve placed all instances of a movieclip that acts as the pointer for the highlights. This movieclip uses a class that animates it upon mouseover/mouseout (hence only two animation functions are required for them all). At the same time I want to display a unique text for every point, and this is where the trouble comes in.  
I figured I could attach data with each instance to the class somehow, and then create a new text field upon accessing the class. This is what I came up with:

```auto
// Features
f1.name = "Växla mellan användnings- och viloläge.";
f2.name = "Display.";
f3.name = "Visa den elektroniska programguiden.";
f4.name = "Visa huvudmenyn.";
f5.name = "Lämna menyn.";
f6.name = "Infraröd sensor (för fjärrkontroll).";
f7.name = "Inspelningsindikator - lyser när inspelning pågår.";
f8.name = "Spela in.";
f9.name = "USB-anslutning för externt minne.";
f10.name = "Kortläsare till ditt programkort."

```

As you can see I tried using the instance property _name_ to attach the data, it failed though (I didn’t get a compile error for this but I couldn’t retrieve the data in the class).  
How would you approach this? Do I have to create a variable for each instance’s data, then match them (same number etc.)? Or is there a simpler way?

Thanks!  
-Staffan
