# Component instance name in a class

**URL:** <https://forum.kirupa.com/t/component-instance-name-in-a-class/276962>\
**Category:** Uncategorized\
**Created:** [December 5, 2008, 5:32pm UTC](https://forum.kirupa.com/t/component-instance-name-in-a-class/276962 "2008-12-05T17:32:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mateomtb](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@mateomtb](https://forum.kirupa.com/u/mateomtb)\
**Post date:** [December 5, 2008, 5:32pm UTC](https://forum.kirupa.com/t/component-instance-name-in-a-class/276962/1 "2008-12-05T17:32:28Z")

</div>

I am using a component from [slideshowpro.net](http://slideshowpro.net) that has a great API that I can use fine with time line code, but I’m struggling trying to utilize it in a sub class.

The component is on the main time line with an instance name of my\_ssp

My struggle is how do I make a component’s instance name available in a class? I know how to set linkage with something like a MovieClip, but you don’t have the same option with a class in the library.

My Document Class

```auto
package {
import flash.display.*;
import net.slideshowpro.slideshowpro.*;
import OnSlideShowData //my new class

public class Main extends MovieClip {

//declaring the instance name so I hope other classes can see it?
public var my_ssp:SlideShowPro

public function Main() {
my_ssp = new OnSlideShowData()
                        
}
}
}

```

my new class. I know this code works on the time line

```auto
package {

import net.slideshowpro.slideshowpro.*;

public class OnSlideShowData extends SlideShowPro {

function OnSlideShowData(event:SSPDataEvent) {
if (event.type=="albumData") {
trace("total images: " + event.data.totalImages);
}
}
my_ssp.addEventListener(SSPDataEvent.ALBUM_DATA, OnSlideShowData);

}
}

```

The error I keep getting is this, which makes me suspect I’m trying to use the same instance name twice?

1151: A conflict exists with definition my\_ssp in namespace internal.

I’ve tried many versions of this and am just plain stuck at this point. Grateful for any pointers.
