我有一段实现 MovieClip 的 Actionscript 代码。我似乎无法让它显示在我的应用程序中。
我试过的:
1) 通过 UIObject 和 Sprite 在我的代码中直接使用该类。我可以创建 UIObject,添加 Sprite,然后添加类的实例。我的应用程序中没有显示任何内容。
2) 将该类作为 flex 库 (swc) 放入。编译器不会让我导入它或将它用作显示对象。
3) 将该类作为 flex 项目 (swf) 放入。该文件独立运行良好,但当我尝试在我的应用程序中使用它时,它给了我相同的“损坏”图标。
我在这里遗漏了一些关键因素。建议?
编辑:让加载项类通过库显示。它编译为 .SWC 文件。不幸的是,它使用全屏作为其“舞台”尺寸。我之前遇到的不可见的问题实际上是(或者我认为)它不在显示窗口的右侧。我在绘图程序中放置了断点,可以看到它正在刷新。所以现在我试图让它接受一些维度。
最佳答案
1) Using the class directly in my code via UIObject and Sprite. I can create the UIObject, add the Sprite and then add an instance of the class. Nothing displays in my app.
你给了移动剪辑和大小吗? (宽度和高度)和位置(x 和 y)?大小通常更重要,因为 x 和 y 通常设置为 0、0。
2) Putting the class in as a flex library (swc). The compiler won't let me import it or use it as a display object.
您是否将 SWC 添加到您的库路径中?您确定您的新影片剪辑包含在 SWC 中吗?
3) Putting the class in as a flex project (swf). The file runs fine stand alone but gives me the same "broken" icon when I try to use it in my app.
听起来您在此处嵌入了路径问题;但你必须显示你的代码。
关于apache-flex - 在 flex 中使用 Actionscript (MovieClip) 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6344335/