如何在Flash中创建Flex Display组件?
我使用 Flash 制作皮肤,将其导入并应用于 Flex 组件。
但是如何在 Flash 中创建具有属性和方法的组件。并使其能够添加到 Flex 应用程序中的 displayList 中?
我安装了 Flash 的 Flex 组件套件。在 Flash 中创建了我的组件(它扩展了 MovieClip)。执行Command->Convert to flex Component
,执行File->Published
,这给了我一个.swc,将.sec 文件放入我的Flex 项目中。现在,当我创建一个新变量时,“FlashFlexComponentTest”类会在新类提示框中弹出,因此 Flex 可以看到它。但后来我收到错误:
类型未找到或不是 编译时常量:FlashFlexComponentTest
我觉得我一定错过了一个步骤?
谢谢!
更新
我通过项目构建路径添加了 .swc ->添加SWC。 我不再有编译时错误,但出现运行时错误:
类型强制失败:无法将 FlashFlexClassTest@9089129 转换为 mx.core.IUIComponent
I have used Flash to make skins, which I import and apply to Flex components.
But how can I create a component in Flash, with properties and methods. And make it able to be added to the displayList in a Flex app?
I installed the Flex component kit for flash. Created my component in flash (it extends MovieClip). Did Command->Convert to flex Component
, did File->Published
, which gave me a .swc, dropped the .sec file into my Flex project. Now when I create a new var the class "FlashFlexComponentTest" pops up in the new class hint box, so flex sees it. But afterwards I get the error:
Type was not found or was not a
compile-time constant: FlashFlexComponentTest
I feel like I must be missing a step?
Thanks!
UPDATE
I added the .swc via project build path -> add SWC.
I no longer have a compile-time error but I am getting a runtime error:
Type Coercion failed: cannot convert FlashFlexClassTest@9089129 to mx.core.IUIComponent
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
所有 Flex 组件的基类 UIComponent 允许您添加未实现 IUIComponent 接口的 Sprite。
一个例子:
The base class for all flex components, UIComponent, allows you to add Sprites that don't implement the IUIComponent interface.
An example :
Linda.com 上有一个关于这方面的很好的视频教程,作者是 David Something。大约一年前,我做了很多这样的事情,这是我找到的最好的资源。并没有涵盖绝对所有可能的角度,但很好地涵盖了您需要了解的内容。
我猜您只是缺少一些小的链接细节。如果是这样的话,本教程应该会让您明白。对我来说,每月订阅 20 美元还是值得的。
抱歉,这是我能做的最好的事情...自去年以来就没有在 Flash 中构建 Flex 组件。
There's a good video tutorial on this at Linda.com by David something. I did a lot of this a year or so ago, and that was the best resource I found. Doesn't cover absolutely every possible angle, but does a great job of covering what you need to know.
I'm guessing there's just some small linkage detail that you're missing. The tutorial should get you straight, if that's the case. It was worth the $20, or whatever, for a monthly subscription for me.
Sorry, that's the best I can do... haven't built Flex components in Flash since last year.
基本上有几个步骤需要做:
有 Jesse Warden 的解释 http://jessewarden.com/2011/06/integrating-flash-components-with-flex-revisited.html
干杯!
basically there are step what need to do:
There is explanation by Jesse Warden http://jessewarden.com/2011/06/integrating-flash-components-with-flex-revisited.html
Cheers!