如何创建 Flash 自定义按钮并在 Flex 中使用它
我正在使用 Flash CS4 和 Flex 3.4.0。我想在 Flash 中创建一个矢量图形按钮并在 Flex 中使用它。
我尝试安装 Flex 组件套件,但它不会向我添加转换所需的 2 个命令,如 此处。
以前有人见过/处理过这个问题吗?
I'm using Flash CS4 and Flex 3.4.0. I'd like to create a vector-graphic button in Flash and use it in Flex.
I'd tried to install the Flex Component Kit, but it won't add me the 2 commands I need for the conversion as stated here.
Anyone has seen/dealt with this problem before?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将 MovieClip 导出为 SWF 并将其用作外观,从而将矢量图像应用到控件上。
更新:
您还可以使用 SVG 文件。 此处对此进行了全部解释。
You can export the MovieClip to SWF and use it as a skin, thus applying vectored image on a control.
Update:
You can also use SVG files. It's all explained here.
是的,不久前发生在我身上。如果我没记错的话,这是CS4的安装问题(组件套件是为CS3设计的)。安装套件后,启动 Extension Manager CS4,然后禁用并重新启用该组件。命令现在应该显示。
但是,您可以“手动”完成这一切,无需 Flex 组件套件。只需将 fps 设置为 24,然后将您想要在 Flex 中使用的剪辑“导出为 Actionscript”即可。请确保使用 mx.flash.UIMovieClip 作为基类(而不是 refular MovieClip)。将生成的文件导出为 .swc,一切就完成了。
顺便说一句,如果您想使用在 Flash 中创建的实际按钮(带有状态、皮肤和所有内容的组件),恐怕您会感到失望。您无法将 Flash 按钮导出为 Flex 按钮,因为它们具有不同的固有链(Flash 使用 flash.display.SimpleButton,而 Flex 使用 mx.controls.Button)。您可以在flex中使用flash按钮,但是您无法利用flex带来的所有优点(工具提示、布局等)。如果有人对这个问题有一个聪明的解决方案,我很想听听。
Yup, happened to me not too long ago. If I recall correctly, it's an installation problem with CS4 (component kit was designed for CS3). After installing the kit, start the Extension Manager CS4, and there disable and re-enable the component. Commands should show up now.
But, you could do it all 'by hand', without the Flex Component Kit. Just set the fps to 24, and 'Export for Actionscript' the clips you'd like to use in Flex. Just be sure to use mx.flash.UIMovieClip as the base class (not the refular MovieClip). Export the resulting file as .swc and you're all set.
BTW, if you want to use an actual button created in Flash (the component, with states, skins and everything), I'm afraid you're gonna be disappointed. You cannot export flash buttons as flex buttons, as they have different inhenritace chain (flash uses flash.display.SimpleButton, and flex uses mx.controls.Button). You can use flash buttons in flex, but you can't leverage all the goodness flex brings with it (tooltips, layout and such). If someone has a clever solution for this problem, I'd love to hear it.