views:

96

answers:

1

Have you tried using straight javascript (rather straight ECMAscript 3 standard) in Flex applications, with none of the ECMAScript 4 enhancements?

If one were to do so, would it be better to let the AS3 compiler build from the javascript, or use the javascript bridge liberally?

+1  A: 

I'm not sure why you'd want to do that in a Flex application, but I've messed with non-strict ECMAScript in Flash Player, and it's certainly a lot of fun. Be sure to set the following command line arguments for the compiler and have all the fun you want with prototypes and very little type checking.

-as3=false -es=true -strict=false

If your ECMAScript is going to be communicating heavily with the Flex app, it's better to run it in Flash Player, for two reasons:

1) The virtual machine in Flash Player is faster than some, if not all, browser JavaScript engines. Much of the improvements to Firefox's JavaScript engine speed recently come from Tamarin, the open source Flash Player VM.

2) Passing many calls through ExternalInterface can be a slow process. Objects need to be converted and some crazy XML needs to get parsed. Keep all the code running on one side and you'll have much better performance.

joshtynjala
Thanks, that's what I was asking for.I prefer the low-overhead late binding style of straight javascript. I can grok the code better if there's simply less of it (and I find myself debugging the app rather than debugging the IDE) And AS3's future is stubbed now that ECMAScript 4 has been rejected.
le dorfier