Question: I am building an SWF panel with support for English and Japanese, and a button to toggle between them. The English is on frame 1, the Japanese on frame 2. On the first frame there is this relevant AS3:

```
btnLangToggle.addEventListener(MouseEvent.CLICK, onLangToggle);

```

...

```
this.stop();

```

...

```
function onLangToggle(e:MouseEvent):void {
    if (MovieClip(root).currentFrame == 1) {
        MovieClip(root).gotoAndStop(2);
    } else {
        MovieClip(root).gotoAndStop(1);
    }
    trace(MovieClip(root).currentFrameLabel);
}

```

I click the button and the event handler function runs fine, once. If I click it again, nothing happens. Why?

Edit: Here is what my two frames and timeline look like.

![English and Japanese UI](https://i.stack.imgur.com/c08hS.png)

![Timeline](https://i.stack.imgur.com/bTMOR.png)

Answer: 
Attach load and resize in the on method with a space like this:

```
$(window).on('load resize', function(){ 

```

you need also to bind resize() method at the end:

```
}).resize();

```
you can also use bind 

```
$(window).bind('load resize', 

```