我正在尝试在flex中设置swiz框架,但似乎无法编译。我使用swiz 0.6.2和flex 3.0.2。 swc位于我的flex项目的libs目录中。
我遵循这里的教程:http://code.google.com/p/swizframework/wiki/DefiningApplicationComponents
我的代码如下:
Swiz.mxml -
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" width="100%" height="100%"
preinitialize="onInitialize()">
<mx:Script>
<![CDATA[
import org.swizframework.Swiz;
private function onInitialize() : void {
// load up swiz beans
Swiz.loadBeans( [ Beans ] );
}
]]>
</mx:Script>
<!-- rest of view -->
</mx:Application>
Beans.mxml -
<?xml version="1.0" encoding="utf-8"?>
<BeanLoader xmlns="org.swizframework.util.*" xmlns:mx="http://www.adobe.com/2006/mxml">
<!-- custom channel set -->
<DynamicChannelSet id="myAmfChannel">
<serverPort>8080</serverPort>
<contextRoot>/demo-web</contextRoot>
</DynamicChannelSet>
<!-- user service -->
<mx:RemoteObject id="userService"
destination="userService"
channelSet="{myAmfChannel}"/>
</BeanLoader>
当我尝试编译时,通过带有静态类型Class的引用获取错误unidentified方法loadBeans。有什么想法吗?
答案 0 :(得分:0)
想通了。这是所有旧的swiz语法,文档已过时。这里有一个理解正确方法的好教程:http://www.firemoss.com/index.cfm/2009/10/21/Swiz-in-20-minutes-video--byebye-boilerplate。