# Loader and ADDED\_TO\_STAGE

**URL:** <https://forum.kirupa.com/t/loader-and-added-to-stage/274630>\
**Category:** flash\
**Created:** [November 1, 2008, 4:38pm UTC](https://forum.kirupa.com/t/loader-and-added-to-stage/274630 "2008-11-01T16:38:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HMPoweredMan](https://avatars.discourse-cdn.com/v4/letter/h/57b2e6/32.png) [@HMPoweredMan](https://forum.kirupa.com/u/HMPoweredMan)\
**Post date:** [November 1, 2008, 4:38pm UTC](https://forum.kirupa.com/t/loader-and-added-to-stage/274630/1 "2008-11-01T16:38:06Z")

</div>

I have a loader loading an external .swf

In my external .swf I have this

```php
this.addEventListener(Event.ADDED_TO_STAGE,addedToStage)

function addedToStage(event:Event):void {
    if(gameStarted == false){
        stage.addEventListener(MouseEvent.CLICK, mouseClick);
        this.removeEventListener(Event.ADDED_TO_STAGE,addedToStage)
        gameStarted = true
    }
}

function mouseClick(event:Event):void{
    this.gotoAndStop("title1")
    stage.removeEventListener(MouseEvent.CLICK, mouseClick);
}

```

NOW When I go to the title 1 frame, everything is fine  
BUT the title 1 frame brings you to title 2 and when that happens, the click event to go to title 1 comes back for an unknown reason.

I’ll post the code for the title 2 frame.

```php
var titleMusic2:Title2 = new Title2()

musicChannel = titleMusic2.play();

stage.addEventListener(KeyboardEvent.KEY_DOWN, Keys2);
function Keys2(event:KeyboardEvent):void{
    if(event.keyCode == 32){
        stage.removeEventListener(KeyboardEvent.KEY_DOWN, Keys2);
        gotoAndStop("stage1")
        musicChannel.stop()
    }
    if(event.keyCode == 13){
        stage.removeEventListener(KeyboardEvent.KEY_DOWN, Keys2);
        gotoAndStop("stage1")
        musicChannel.stop()
    }
}

```

Why is the click event listener coming back? I ADDED\_TO\_STAGE being called more than once? If so is there another method?
