Flex 引用 SWC 文件中的图像

发布于 2024-07-14 03:00:14 字数 33 浏览 1 评论 0原文

如何在 Flex 中引用 SWC 文件中包含的图像?

How do I reference an image in Flex that has been included in the SWC file?

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

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

发布评论

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

评论(1

獨角戲 2024-07-21 03:00:14

使用 Embed 元数据标记。 类似于:

source="@Embed(source='relativeOrAbsolutePath')"

此处给出了嵌入资源的语法< /a>:

用于嵌入资产的语法取决于您在应用程序中嵌入资产的位置。 Flex 支持以下语法:

* [Embed(parameter1, paramater2, ...)] metadata tag

  You use this syntax to embed an asset in an ActionScript file, or in an <mx:Script> block in an MXML file. For more information, see Using the [Embed] metadata tag.
* @Embed(parameter1, paramater2, ...) directive

  You use this syntax in an MXML tag definition to embed an asset. For more information, see Using the @Embed() directive in MXML.
* Embed(parameter1, paramater2, ...) directive

  You use this syntax in an <mx:Style> block in an MXML file to embed an asset. For more information, see Embedding assets in style sheets.

所有三种嵌入语法均可让您访问相同的资源; 唯一的区别在于您在应用程序中使用它们的位置。

请阅读有关从文档。 另外,嵌入式资产类别

Use the Embed metadata tag. Something like:

source="@Embed(source='relativeOrAbsolutePath')"

The syntax for embedding resources is given here:

The syntax that you use for embedding assets depends on where in your application you >embed the asset. Flex supports the following syntaxes:

* [Embed(parameter1, paramater2, ...)] metadata tag

  You use this syntax to embed an asset in an ActionScript file, or in an <mx:Script> block in an MXML file. For more information, see Using the [Embed] metadata tag.
* @Embed(parameter1, paramater2, ...) directive

  You use this syntax in an MXML tag definition to embed an asset. For more information, see Using the @Embed() directive in MXML.
* Embed(parameter1, paramater2, ...) directive

  You use this syntax in an <mx:Style> block in an MXML file to embed an asset. For more information, see Embedding assets in style sheets.

All three varieties of the embed syntax let you access the same assets; the only difference is where you use them in your application.

Read the section on loading resources from the documentation. Also, Embedded Asset Classes.

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