简体   繁体   English

如何将自己的自定义组件加载到AIR应用程序中?

[英]How can I load my own custom component into an AIR application?

I created separate own canvas component for Home page, Contact page, Rules page etc. In my main application it has link button like Home,Contact,Rules in application controller(child state) . 我为主页,联系人页面,规则页面等创建了单独的画布组件。在我的主应用程序中,它在应用程序控制器(子状态)中具有链接按钮,例如主页,联系人,规则。

 <?xml version="1.0" encoding="utf-8"?><mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="903" height="508" backgroundImage="@Embed(source='image/mainbackground.png')">
<mx:label x="483" y="166" label="Welcome to our site"/>
<mx:DateChooser x="229" y="166"/>   

If you click home button then show homepage canvas. 如果单击主页按钮,则显示主页画布。 How can i Implement? 我该如何实施? or refer me any url for study 或将任何网址推荐给我

Between the script tags 脚本标签之间

   public static const HOME:Number = 0;
   public static const CONTACT:Number = 1;

You can use a viewstack to display different views and myStack.selectedIndex is just a number but I like it more to do this with a static value so you only have to change it on one place if something changes 您可以使用视图堆栈显示不同的视图,而myStack.selectedIndex只是一个数字,但我更喜欢使用静态值来执行此操作,因此,如果发生某些更改,只需在一个位置上进行更改

<mx:LinkButton label="home" click="{myStack.selectedIndex = HOME}"/>

<mx:ViewStack id="myStack" creationPolicy="auto" width="100%" height="100%">
       <view:Home/>
       <view:Contact/>
</mx:ViewStack>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在AIR应用程序中的自定义组件之间进行数据绑定? - How to databinding between custom component in AIR application? 如何将移动AIR应用程序保持在横向模式下? - How do I keep my mobile AIR application on landscape mode? 如何为Flex AIR应用程序使用自定义图标? - How do I use a custom icon for my Flex AIR app? 如何将电子邮件从Outlook拖到Adobe AIR应用程序中 - How can I drag an eMail from Outlook into an Adobe AIR application 如何在特定AIR应用程序上检测和调用用户的AIR运行时本地安装? - How can I detect and invoke a user's local installation of the AIR runtime on a particular AIR application? 如何让我的AS3 / Air代码更好? - How can I make my AS3/Air code better? 我们可以在Winform应用程序中注入基于flex / air的组件吗? - can we inject flex/air based component in winform application? 卸载任何air应用程序时如何删除应用程序存储目录实例/数据 - how can i delete application storage directory instance/data when uninstalling any air application 我需要在Horizo​​ntalList,Flex3 Air应用程序中加载多个swf - I need to load multiple swf in HorizontalList, Flex3 Air application 如何在我的AIR应用程序中附加文件扩展名,该文件扩展名默认情况下是通过AIR应用程序打开的? - How to attach file extension with my AIR application that by default open with my AIR application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM