Flex classes in Pure AS3 projects
According to this blog article , some Flex components such as the Flex WebService and HTTPService don't rely on the Flex framework, so it should be possible to import and use them i开发者_运维知识库n a pure AS3 project.
I often wonder if Adobe could have designed Flex with a modular approach similar to that of the Zend framework, whereby some of the classes could have been imported without having to load the full framework.
Do you know of any other Flex components/classes that could be used in such a way?
The Flex Compiler--which is used in pure ActionScript projects compiled w/ Flash Builder--will optimize itself. Only the classes you use go into the final SWF. So, the final file size will no be affected if you put 100 classes in your library path and never use them. So, feel free to add the Flex SWC information and just use the HTTPService and/or WebService.
I would assume if you are using Flash Pro that similar optimizations occur when creating the final SWF.
That said, Adobe does seem to be moving in the direction of separating out Flex. Flex 4 classes, for example, are located across 10 different SWCs. Mobile classes in Flex Hero are also isolated, adding at least one more SWC to the mix.
I suggest you take a look at the rpc.swc class, as I guess that is where the HTTPService and other related classes reside.
The Text Layout Framework and OSMF are also part of the Flex framework but could be used in a pure AS3 project
精彩评论