What are the main differences between Flash ActionScript and Flex Actionscript? Why can not Flash directly compile AS files generated from Flex?


What are main differences between flash ActionScript and Flex actionscript? Why Flash can not compile AS files generated from Flex (with keep-as) directly?

Some problem is - I want to compile generated from MXML .AS files using Flash CS5... But it appears to me I can not... Why?

The reason is that there's a difference between Flex Builder (the software program you use to create Flex apps) and the Flex Framework.

The Flex Framework is a set of classes and components built on ActionScript that extend what's already there. Flex Builder has access to all of the code in the Flex Framework - Flash Professional does not.

That's why, for instance, the [Bindable] keyword doesn't work in Flash - all of the code that makes it magically work in Flex apps doesn't exist in Flash.

That said, they've come a long way towards integrating the two. Right now you can build a component in Flash CS5 and drop it into Flash Builder (they renamed Flex Builder to Flash Builder recently) and use it - but it's still not possible to take an .mxml file from Flash Builder and compile it in Flash.

I hope that helps, I know the distinctions can be tricky.