# Swf in browser-speed problem "wmode"?

**URL:** https://forum.kirupa.com/t/swf-in-browser-speed-problem-wmode/155065
**Category:** Uncategorized
**Created:** [July 14, 2005, 2:45pm UTC](https://forum.kirupa.com/t/swf-in-browser-speed-problem-wmode/155065 "2005-07-14T14:45:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ondo](https://avatars.discourse-cdn.com/v4/letter/o/ecb155/32.png) [@ondo](https://forum.kirupa.com/u/ondo)
#### Post date: [July 14, 2005, 2:45pm UTC](https://forum.kirupa.com/t/swf-in-browser-speed-problem-wmode/155065/1 "2005-07-14T14:45:38Z")

</div>

Hi!  
I have a problem whit speed in FireFox 0.8, when i exported swf it plays good in Flash Player, but when i embaded it to HTML whit wmode=“window” at beginning it plays fast and after few moments performance rapidly go down, when i put wmode=“opaque” performance is good but I loosing key control over swf…

in IE performanse is slow in eny case -and no loosing control- bug… but I need that best performans ![](http://forum.kirupa.com/uploads/kirupa/798/c985a958819d8917.gif)

here is links  
[wmode=WINDOW](http://www.avistudio.sk/game/test/speedtest_wmodeWINDOW.html)  
[wmode=OPAQUE](http://www.avistudio.sk/game/test/speedtest_wmodeOPAQUE.html) here is problem with Key.isDown(), no response whit Firefox 0.8, but i like the speed

any advice will be helpfull… Thanks.

…o i forgot to said about the swf and AS:  
there is 6 MC:  
1st is just a sprite (20 frames long ) named “b”.  
2nd is FrameCounter whit 1 frame and whit AS on first frame

ActionScript:  
ticks=0;  
oldticks=0;  
this.onEnterFrame = main;  
if (oncePerSecondInterval == undefined) { //- start set interval which calculates fps  
oncePerSecondInterval = setInterval(oncePerSecond, 1000);  
}  
function oncePerSecond() {  
fpsText = (ticks-oldticks) + “/120”; //- display fps  
oldticks = ticks;  
}  
function main() {  
ticks++; //- used to calculate fps  
}

and 4 buttons MCs…

on Scene is also one frame and whit this AS on first frame…

ActionScript:  
step=1;  
var keyListener:Object = new Object();

keyListener.onKeyUp = function() {  
var c=Key.getCode();  
if (c==37) {  
l.gotoAndStop(1);  
} else if (c==38) {  
u.gotoAndStop(1);  
} else if (c==39) {  
r.gotoAndStop(1);  
} else if (c==40) {  
d.gotoAndStop(1);  
}  
};  
Key.addListener(keyListener);  
this.onEnterFrame=function() {  
if (Key.isDown(Key.RIGHT)) {  
r.gotoAndStop(2);  
b.\_x+=step;  
} else if (Key.isDown(Key.LEFT)) {  
l.gotoAndStop(2);  
b.\_x-=step;  
} else if (Key.isDown(Key.UP)) {  
u.gotoAndStop(2);  
b.\_y-=step;  
} else if (Key.isDown(Key.DOWN)) {  
d.gotoAndStop(2);  
b.\_y+=step;  
}  
}
