Flex (compc) 生成的 SWC 上的实时预览

发布于 2024-07-27 12:27:39 字数 594 浏览 3 评论 0原文

有谁知道 Flash 使用什么标准来发现组件的实时预览类?

背景

我们正在尝试自动创建包含要从 Flash 使用的组件的 SWC。 我们可以通过修改manifest.xml并连接组件定义来使其对Flash可见。 但是,该组件无法拖动到舞台(或库)上,大概是因为它没有 LivePreview 形式。

为了更好地说明我们的来源,我们注意到从 Flash 导出的 SWC(使用 swfdump)中存在以下内容:

  • fl.livepreview.LivePreviewParent 包含相同的 mod属性作为manifest.xml文件中的可视组件
  • fl.livepreview.LivePreviewParent 导出为符号
  • 简称组件(即无包,在manifest.xml中的组件定义中引用)导出为符号

但是,我看不出它与 Flex 中的 SWC 之间没有其他差异。

显然,我们可以使用 JSFL 来执行该任务,但我们不想在构建服务器上安装 Flash。

有什么想法吗?

Does anyone know what criterea Flash uses for discovering the Live Preview class for a Component?

Background

We are attempting to automate the creation of a SWC that contains a component to be used from Flash. We are able to make it visible to flash by modifying the manifest.xml and wiring up the component definitions. However, the component cannot be dragged onto the stage (or library), presumably because it has no form of LivePreview.

To give better clarification of where we are coming from, we've noticed the following in SWCs exported from Flash (using swfdump):

  • fl.livepreview.LivePreviewParent contains the same mod attribute as the visual component in the manifest.xml file
  • fl.livepreview.LivePreviewParent is exported as a symbol
  • The short-named component (ie. no package, referenced in the components definition in the manifest.xml) is exported as a symbol

However, I can see no other differences between that and the SWC from Flex.

We can obviously use JSFL to perform the task, but we'd rather not install Flash on the build server.

Any thoughts?

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

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

发布评论

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

评论(2

七秒鱼° 2024-08-03 12:27:39

您可以使用 UIComponentGlobals.designMode 属性。

导入 mx.core.UIComponentGlobals;

私有函数 onInitialize():void
{
if ( UIComponentGlobals.designMode )
{
// 显示设计视图特定的内容
}
别的
{
//正常渲染
}
}

更多信息,http://cookbooks.adobe.com/post_How_do_I_detect_at_runtime_if_my_component_is_bein-13446.html

You can use UIComponentGlobals.designMode property.

import mx.core.UIComponentGlobals;

private function onInitialize():void
{
if ( UIComponentGlobals.designMode )
{
// show something design view specific
}
else
{
//render normally
}
}

more info here, http://cookbooks.adobe.com/post_How_do_I_detect_at_runtime_if_my_component_is_bein-13446.html

苍白女子 2024-08-03 12:27:39

您需要提取 .swc 文件,它将包含一个 Library.swf,您必须将其用作 LivePreview。 当您对组件的属性进行更改时,这些更改将反映在 LivePreview 中。 如果您有许多组件,则必须为每个组件生成实时预览。 我是在 Flash Authoring Tool 中使用 v3 组件架构开发组件时完成的。

希望有帮助..

--
最好的;
切坦
http://chetansachdev.com

You need to extract the .swc file, it will contain a library.swf, which you will have to use as your LivePreview. When you make the changes in the properties of the component, those changes will get reflected in the LivePreview. If your have many components, you will have to generate live preview for each one of those. I had done it while developed components in Flash Authoring Tool, using v3 Component architecture.

Hope that helps..

--
Best;
Chetan
http://chetansachdev.com

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