简体   繁体   中英

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 in 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.

文本布局框架和OSMF也是Flex框架的一部分,但可以在纯AS3项目中使用

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM