# Namespaces for event listener functions ! argh!

**URL:** https://forum.kirupa.com/t/namespaces-for-event-listener-functions-argh/323347
**Category:** Uncategorized
**Created:** [June 26, 2011, 11:39pm UTC](https://forum.kirupa.com/t/namespaces-for-event-listener-functions-argh/323347 "2011-06-26T23:39:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Sophie\_Horner](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@Sophie\_Horner](https://forum.kirupa.com/u/Sophie_Horner)
#### Post date: [June 26, 2011, 11:39pm UTC](https://forum.kirupa.com/t/namespaces-for-event-listener-functions-argh/323347/1 "2011-06-26T23:39:19Z")

</div>

Ok, I’m new to this forum so…

```auto
trace("Hello!");

```

I’m up late coding and I’ve come to a halt here’s why:

I’m looking (desperately) for something that will explain why my “public class marquePage” is not working properly. I don’t have access to the actual file right now - on a friend’s computer - but i’ll try and make this clear, here it goes :

```auto
// example : (having declared the namespaces at package level and embedded the pictures in separate classes "photosMP", etc)

public var ceNom:Namespace;
public var cetteListe:Array = [photos, dessins, livres, maous];
photos var cetMP:photosMP = new photosMP();
dessins var cetMP:dessinsMP = new dessinsMP();
livres var cetMP:photosMP = new livresMP();
maous var cetMP:photosMP = new maousMP();

public function marquePage():void {

for (var i:int=0;i<4;i++) {
ceNom = cetteListe*;
 addChild(ceNom::cetMP);
ceNom::cetMP.addEventListener(MouseEvent.CLICK, ceNom::bouger);

}
// 4 qualified functions, one for each namespace to respond to the MouseEvent example "photos function bouger(me:MouseEvent):void {...}"
}

```

Somehow, the event listener doesn’t want to know about namespaces… in fact, everything comes up ok except that when you click on any of the bookmarks (cetMP), nothing happens at all !

SOS !
