我创建了一个 Flex 库项目,其中包含一个带有一个组件(一个按钮)的 .MXML 文件。它在 myLibrary.views 包中称为 Button.mxml。
然后我创建了一个不同的 Flex Mobile 项目,我想在其中包含我的库项目中的按钮。这个项目引用了之前创建的库。
我找不到如何实现这一目标的答案。
我可以像 mxml 组件一样添加它吗?
<?xml version="1.0" encoding="utf-8"?>
< s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
applicationDPI="240">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import myPackage.views.Button; // this is the package containing Button.mxml
]]>
</fx:Script>
<myPackage.Views.Button id="myButton" /> // is this possbile somehow ???
</s:Application>
谢谢!