Game performs smoothly in IDE but sloppy in the browser

I am currently making for fun a racing game. When it started to get in shape, I decided to try it in a browser.

Now, when using CTRL+Enter or running the swf file, it was all working really smoothly. But when I ran it through a browser (when publishing, I generated html file and opened it in FireFox) it was extremely sloppy.

My first thought is that there are too many calculations which resulted in low fps. I downloaded and put a script to measure the fps. In both, IDE and browser, the movie was played back with max fps of 24. When I increased it to 50 it was still reaching max fps in both, yet in browser movie was still really sloppy (though it was a little bit better than with max fps being 24). When raised to 100, playback in browser was capped at 60fps on different computers so I guess it’s a flash player cap. Movie was still not smooth at all.

Also, setting the quality to Low didn’t help almost at all.

The whole “logic” of the game works on Timer thing. I mean each 50ms it fires a function that does all the calculation stuff. Using this solution, 20fps should be just enough.

If it helps, here is the game - http://swtor-online.com.pl/inne (use arrow keys). Thanks for any help.

PS. I think I wasn’t really precise - when played back in browser, the game is still “smooth”, but just works really slow.