# Keyboard Events and External SWF

**URL:** <https://forum.kirupa.com/t/keyboard-events-and-external-swf/312786>\
**Category:** flash\
**Created:** [August 12, 2010, 2:05pm UTC](https://forum.kirupa.com/t/keyboard-events-and-external-swf/312786 "2010-08-12T14:05:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dwsimms](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@dwsimms](https://forum.kirupa.com/u/dwsimms)\
**Post date:** [August 12, 2010, 2:05pm UTC](https://forum.kirupa.com/t/keyboard-events-and-external-swf/312786/1 "2010-08-12T14:05:22Z")

</div>

OK. So, I finally found a way to exactly position my External SWF on the main stage. Here is the Actionscript I placed on an empty layer:

```auto
this.createEmptyMovieClip("externalSWF",1);
externalSWF._x=550;
externalSWF._y=300;
externalSWF.loadMovie("donation.swf");
preloadI=setInterval(preloadF,100);
function preloadF(){
bl=externalSWF.getBytesLoaded();
bt=externalSWF.getBytesTotal();
if(bl>0&&bl>=bt){
clearInterval(preloadI);
externalSWF._width =720;
externalSWF._height=480;
}
}

```

As you can see, I created an empty movie clip and loaded the SWF into that. Now, here is my question. The external SWF has keyboard events to navigate around it. But, when I load it into this empty movie clip, the keyboard events don’t work. Do I need to set the focus? Do I need to import the keyboard events?

How do I do this in Actionscript 2?
