Flash is mpeg4 encoded which is patent encumbered by the finest patent trolls in the world. The decode licence expired recently, but was renewed a few weeks before that for a period TWO years. Further encoding for "commercial" purposes requires a mandatory licence. And the standards development body are amongst the best bunch of crooks one could aspire to be.
No way am I going to touch flash.
You need not worry about any of these things by a simple tweak. use "just" the socket communication functionality of Flash.
Leave rest of the UI to JS. Its literraly one line of code for each API for that API to be exposed to JS.
So you can create a couple of classes that encapsulate socket communication. And expose those classes to JS. In that case you would not be using any patented functionality. And this would work with Open Source flash runtimes (VMs) that are not controlled by Adobe.
On the other hand, you can do the same things with Java too. I.e. develop the UI in JS and leave only socket communication to Java.
-Shamit