热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

在FlashCS4中使用alchemy生成的swc-usingalchemygeneratedswcinFlashCS4

IvegoneovertheAlchemyquickstartguideandexportedmystringecho.swcsuccessfully,butIdon

I've gone over the Alchemy quick start guide and exported my stringecho.swc successfully, but I don't want to compile in Flex. I just don't know Flex and I'm not very keen on learning it all of a sudden. I tried to do my business in Flash, instead, considering that they both run on AS3. The Flex code they give as an example is

我已经浏览了Alchemy快速入门指南并成功导出了我的stringecho.swc,但我不想在Flex中编译。我只是不知道Flex而且我不是很热衷于突然学习它。我尝试在Flash中开展业务,相反,他们都在AS3上运行。他们给出的Flex代码是一个例子

package
{
    import flash.display.Sprite;
    import cmodule.stringecho.CLibInit;

    public class EchoTest extends Sprite
    {
        public function EchoTest()
        {
            var loader:CLibInit = new CLibInit;
            var lib:Object = loader.init();
            trace(lib.echo("foo"));
        }
    }
}

I've added my swc in the Flash CS4 options and thought I could convert the Flex code into the following AS3 Flash code, written in the timeline:

我已经在Flash CS4选项中添加了我的swc,并认为我可以将Flex代码转换为以下AS3 Flash代码,在时间轴中编写:

import cmodule.stringecho.CLibInit;

var loader:CLibInit = new CLibInit;
var lib:Object = loader.init();
trace(lib.echo("foo"));

But, alas, I get the following error at runtime: ReferenceError: Error #1065: Variable MainTimeline is not defined.

但是,唉,我在运行时遇到以下错误:ReferenceError:错误#1065:未定义变量MainTimeline。

I've not enough experience with Flex, but quite a lot with Flash, but that error tells me nothing at all. I haven't heard of any properties of the stage object or whatever called MainTimeline. Could someone tell me why I get the error or why what I'm doing is just plain stupid?

我没有足够的使用Flex的经验,但使用Flash的经验相当多,但这个错误根本没有告诉我任何事情。我没有听说过舞台对象的任何属性或任何名为MainTimeline的属性。有人能告诉我为什么我得到错误或为什么我正在做的只是简单的愚蠢?

1 个解决方案

#1


Never mind, I made it work. Under Profile->Edit->SWF Settings, I checked "Export SWC". Not sure why it works, maybe someone could still give me a logical explanation...

没关系,我做到了。在Profile-> Edit-> SWF Settings下,我选中了“Export SWC”。不知道为什么会有效,也许有人还能给我一个合乎逻辑的解释......


推荐阅读
author-avatar
mobiledu2502912277
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有