# Can't access listener object from ActionScript file?

**URL:** <https://forum.kirupa.com/t/cant-access-listener-object-from-actionscript-file/222700>\
**Category:** flash\
**Created:** [April 16, 2007, 10:29am UTC](https://forum.kirupa.com/t/cant-access-listener-object-from-actionscript-file/222700 "2007-04-16T10:29:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![darthmahon](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@darthmahon](https://forum.kirupa.com/u/darthmahon)\
**Post date:** [April 16, 2007, 10:29am UTC](https://forum.kirupa.com/t/cant-access-listener-object-from-actionscript-file/222700/1 "2007-04-16T10:29:31Z")

</div>

Hi Guys,

Trying to access a listener that I have created in a .as file from within a .fla file. My chapters.as class is as follows:

```auto

// Define Chapters
class Actions.chapters {
    
    // Constructor function that is called from external swf file
    public function chapters() {
        
        var broadcaster:Object = new Object();
    
        AsBroadcaster.initialize(broadcaster);
        
        var listener:Object = new Object(); 
        
        listener.chapterChange = function() {
            trace("Chapter Changed");
        }
        
        broadcaster.addListener(listener);
        
    }

}

```

In my FLA, I have this:

```auto

// Import chapters
import Actions.chapters;

// create an instance of the Chapters
var chapterInstance:chapters = new chapters();

var _currentlabel = "startup";
_level0.broadcaster.broadcastMessage("chapterChange");

```

Now I was expecting my broadcastMessage to appear via trace, but it doesn’t do a thing.

Any ideas on how I can access this properly or do I have to define the listener object within the .FLA file? Cheers, Chris
