You cannot simply embed JavaScript or HTML inside a Flash movie. However, Actionscript is very similar to JavaScript, so you may be able to reuse much of your code without too much difficulty.
It is possible that someone has written a simple JavaScript engine for Flash, but I don't know of one...
If you find a good solution, it would be useful to write about it here.