简体   繁体   English

Flex - 在后台运行空气应用

[英]Flex - Run Air Application In Background

I am trying to provide my users with the option to have my application launch automatically and complete a task at a certain time every week. 我正在尝试为我的用户提供自动启动应用程序并在每周特定时间完成任务的选项。

I can make my application launch at log in using NativeApplication.nativeApplication.startAtLogin=true but I then want to detect if the time is the time they selected and if it isn't then run the application in the background until the time does match or the user shuts down their computer. 我可以使用NativeApplication.nativeApplication.startAtLogin = true在登录时启动我的应用程序,但我想检测时间是否是他们选择的时间,如果不是,则在后台运行应用程序直到时间匹配或用户关闭他们的电脑。

Does anyone know of a way to do this? 有谁知道这样做的方法? On Adobe's webpage comparing Flex web apps and desktop apps it implied to me that applications could be run in the background but I'm struggling to find anything. 在Adobe的网页上比较Flex网络应用程序和桌面应用程序,它暗示我可以在后台运行应用程序,但我很难找到任何东西。

You can close the initial native window without killing the process 您可以关闭初始本机窗口而不会终止进程

NativeApplication.nativeApplication.autoExit = false;
NativeWindow(this.stage.nativeWindow).close();

OR 要么

You can close the initial native window and create a new window that acts as a desktop widget without appearing in the taskbar with either the UTILITY or LIGHTWEIGHT window type. 您可以关闭初始本机窗口并创建一个充当桌面窗口小部件的新窗口,而不会在任务栏中显示UTILITY或LIGHTWEIGHT窗口类型。

http://help.adobe.com/en_US/air/reference/html/flash/display/NativeWindowInitOptions.html#type http://help.adobe.com/en_US/air/reference/html/flash/display/NativeWindowInitOptions.html#type

Either you keep the process running which times when the next 'job' should be ran, or you can set a system cron job (or something similar) which is specific to the OS. 要么在运行下一个“作业”的时候保持进程运行,要么可以设置特定于OS的系统cron作业(或类似的东西)。 You'll want to use the NativeWindow option of 'LIGHTWEIGHT' so that your application doesn't show up to the user. 您将需要使用'LIGHTWEIGHT'NativeWindow选项,以便您的应用程序不会显示给用户。

Personally, for these kinds of processes, I don't even try to use Air since it isn't really made for this kind of stuff. 就个人而言,对于这些类型的过程,我甚至不尝试使用Air,因为它并不是真的用于这种类型的东西。 It's meant to be used for UI based apps and not process based. 它旨在用于基于UI的应用程序而不是基于进程的应用程序。 Use Java or C# instead. 请改用Java或C#。

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

相关问题 如何在Flex AIR应用程序中动态运行JavaScript? - How to run JavaScript dynamically in a Flex AIR application? 使用ffmpeg捆绑Flex AIR应用程序 - Bundle Flex AIR application with ffmpeg Flex / AIR应用程序桌面工具栏 - Flex/AIR Application Desktop Toolbar 如何在设计为在Windows上运行的独立AIR应用程序中在没有Flex Framework的情况下在Actionscript 3中创建警报对话框 - How to create an Alert Dialog in Actionscript 3 without the Flex Framework in a standalone AIR application designed to run on Windows Flex / AIR-在发布应用程序中显示ActionScript错误 - Flex/AIR - Displaying ActionScript errors in a release application 在另一个AIR应用程序中加载Flash / Flex应用程序 - Loading Flash / Flex Applications in another AIR Application 关于air(flex)应用程序服务器连接 - about air(flex) application server connection Flex AIR - IntelliJ中的application.xml在哪里 - Flex AIR - Where is application.xml in IntelliJ 在Adobe Flex / AIR应用程序中调整应用程序窗口大小时调整容器大小 - Resizing container on resize of application window in Adobe Flex/AIR Application 如何在Flex 3.5应用程序中在运行时更改应用程序背景颜色? - How do I change the application background color at run-time in a Flex 3.5 application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM