Flex: swiz .6.2 未定义方法 loadbeans

发布于 2024-08-06 17:47:58 字数 1584 浏览 2 评论 0 原文

我正在尝试在 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>

当我尝试编译时,我收到错误未识别的方法 loadBeans 通过静态类型 Class 的引用。有什么想法吗?

I'm trying to set up the swiz framework in flex but cant seem to get it to compile. Im using swiz 0.6.2 and flex 3.0.2. The swc is in the libs directory of my flex project.

Im following the tutorial here: http://code.google.com/p/swizframework/wiki/DefiningApplicationComponents

and my code looks like:

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>

when i try to compile i get the error unidentified method loadBeans through a reference with static type Class. any thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你丑哭了我 2024-08-13 17:47:59

想通了。这都是旧的 swiz 语法,文档已经过时了。理解正确方法的一个很好的教程在这里:http://www.firemoss.com/index.cfm/2009/10/21/Swiz-in-20-mines-video--byebye-boilerplate

figured it out. this is all old swiz syntax and the docs were outdated. a great tutorial for understanding the correct way is here : http://www.firemoss.com/index.cfm/2009/10/21/Swiz-in-20-minutes-video--byebye-boilerplate .

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文