# Problem with events of SWF

**URL:** https://forum.kirupa.com/t/problem-with-events-of-swf/260021
**Category:** flash
**Created:** [May 11, 2008, 6:48pm UTC](https://forum.kirupa.com/t/problem-with-events-of-swf/260021 "2008-05-11T18:48:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![shadows](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@shadows](https://forum.kirupa.com/u/shadows)
#### Post date: [May 11, 2008, 6:48pm UTC](https://forum.kirupa.com/t/problem-with-events-of-swf/260021/1 "2008-05-11T18:48:26Z")

</div>

HI all!!

I have a problem. I load a SWF on my flash application on frame 133 with this code:

```auto
this.createEmptyMovieClip("load",0);
loadMovie("teste.swf", load);
load._x = 80.0;
load._y = 300.0;
load._xscale = 80;

```

The first time it loads, i can press the RIGHT arrow key and it will continue to play the SWF, but when i press the LEFT arrow key, it won’t play the SWF’s LEFT arrow key event,but it plays the LEFT arrow key of the main timeline, because i have a key listener in the main timeline to go foward or back pressing the arrow key. How can i solve this problem?? help me please. thanks in advance.

here is the code for the key listener

```auto

 
// this is the object that will listen, #1
 var keyListener:Object = new Object ();
// this is what the object will do
 keyListener.onKeyDown = function ():Void {
 trace("keyGode: " + Key.getCode());
 if (Key.getCode() == 37 ) { // left arrow
     _root.gotoAndStop(2);
 }
 if(Key.getCode () == 39 ){ // right arrow
  _root.gotoAndStop(3); }
}  
 
 
// tell the object what to listen for
Key.addListener(keyListener);

```
