Adobe Air 中的用户登录验证和预加载器 [英] User Login validation and preloader in Adobe Air

查看:23
本文介绍了Adobe Air 中的用户登录验证和预加载器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找出验证用户身份并在 Adob​​e Air [桌面应用程序,而不是基于网络的 flex 应用程序] 中加载应用程序(同时显示预加载器)的方法.

I am trying to figure out ways to authenticate a user and load the application (while showing a preloader) in Adobe Air [desktop application, and not web based flex app].

这是我迄今为止能够实现的:- 一个窗口要求登录详细信息,一旦验证,我将登录窗口设置为不可见并打开应用程序主窗口的一个实例.这有两个问题:-

This is what I have been able to achieve so far:- A window asks for login details, once validated I make the login window invisible and open an instance of the application's main window. There are 2 problems with this:-

  1. 我必须打开一个新窗口(总共 2 个窗口).如果我能够简单地在一种状态下显示登录表单而在另一种状态下显示主应用程序视图,那会更好看.我也尝试过,但问题是除了视图组件之外,flash 确实执行所有动作脚本并保持其他状态准备就绪.有一些以应用程序视图为中心的动作脚本开始抛出空引用错误等.最重要的是,整个事情需要一段时间才能显示,因为创建了两个视图,尽管只显示了其中的一个
  2. 我想在用户通过身份验证后显示预加载器,直到加载主应用程序视图

简而言之,这就是我想要做的:-

In a nutshell, this is what I am trying to do:-

  1. 尽快加载登录窗口并停在那里(应用程序其他部分的动作脚本不应运行)
  2. 验证后,加载应用程序的主视图.显示预加载器直到加载完成
  3. 在同一窗口中加载主视图(而不是打开一个新窗口并使登录不可见)

需要有关如何执行此操作的帮助和指导.

Need help and direction as to how this could be executed.

谢谢!

更新 1

好的,现在我已经设法将功能整合到一个窗口中.然而,国家之间的过渡并非一帆风顺.状态 1 是登录屏幕.如果用户输入正确的登录凭据,则视图的状态 2 将变为活动状态.

Ok, so now I've managed to consolidate the functionality in a single window. however, the transition between states is not a smooth one. State 1 is the login screen. If the user enters the correct login credentials, State 2 of the view becomes active.

现在加载状态 2(它有一堆 UI 组件和一个带有大量数据的网格)需要时间.在那之前,该应用程序会显示为空白,然后所有内容都显示为混蛋.过渡可以更顺利吗?只需显示正在加载..."就足够了.因为状态 2 不会出现,直到所有它都被构建,并且一旦我将当前状态更改为状态 2,状态 1 就会消失.已加载!

Now for State 2 to load (its a bunch of UI components and a grid with loads of data) it takes time. Until then, the application blanks out and then all of it is shown in a jerk. Can the transition be made much smoother? Just showing 'Loading...' would suffice. Because State 2 won't show up until all of it has been constructed and State 1 dies away as soon as I change the current state to State 2. Is there any way to monitor the progress and changing the state only when the next state has been loaded!

更新 2

好的,我让过渡动画在状态之间工作.但是,转换开关仍然存在问题.问题是我登录验证后切换到的状态有很多组件,显示很多数据.有没有办法可以附加侦听器(如果有的话),当状态加载完成并且视图已经生成时我可以触发它!过渡中的当前 jerk like 效果是因为状态已更改但视图尚未完成.

Ok, I got the transition animation to work between states. However, there still exists a problem with the transition switch. The problem is that the state I switch to after login has been verified has a lot of components and shows a lot of data. Is there a way I can attach Listeners (if any), which I can fire when the state loading is complete and view has been generated! The current jerk like effect in the transition is because the state has changed but the view has not completed yet.

状态更改为状态 2 并不顺利,因为状态 2 从数据库加载了大约 10000 行数据.在状态 2 完全提取并提取所有数据后,有没有办法可以为用户明显地更改状态?creationComplete 在这里没有多大帮助.

State Change to State 2 is not smooth as State 2 loads about 10000 rows of data from database. Is there a way I can change the state visibly for the user, after state 2 has been completely drawn out and has pulled in all data? creationComplete doesn't help much here.

简而言之,有没有办法从初始状态开始加载状态,并使其仅在完全加载时才可见?即我可以从状态 1 触发事件到加载状态 2,但是只有在状态 2 完全加载时才能明显地转换到状态 2..

In short, is there a way to start loading a state from an initial state and make it visible only when its complete loaded? i.e. can I fire an event from state 1 to load state 2, but to visibly transition to state 2 only when state 2 is completely loaded..

更新 3

经过一周的灭火、发布赏金和通过网络清理,我仍然无法解决这个问题!在创建 UI 和加载数据时,我的应用程序窗口变得无响应.在 Windows 中,它甚至会在窗口标题栏中显示无响应"约 5 秒钟.所以它的 UI 卡住了,因为数据需要一些时间来获取和加载 - 默认情况下,所有这些都发生在单个线程中.

After a week of firefighting, posting a bounty and scavenging through the web I have still not been able to fix this! My application window becomes unresponsive for the time the UI is created and data is loaded. In Windows, it even shows 'Not Responding' at the window title bar for about 5 seconds. So its the UI getting stuck because the data is taking some time to be fetched and loaded - all of this happens in a single thread by default.

基于 Adob​​e Air 开发的人是如何做到这一点的?我经常在实际游戏加载之前看到加载屏幕 - 当它加载时,它的功能齐全.一定有办法!

How do people who develop based on Adobe Air do this? I've mostly always seen a loading screen before the actual game is loaded - and when its loaded, its fully functional. There has to be a way!

推荐答案

在网格中加载 10000 行的耗时问题可以出现在任何 Web 应用程序中的任何基于 Web 的语言中,因为 Web 应用程序需要在具有自身资源限制的 Web 浏览器.

The time consuming problem of loading 10000 rows in a grid can come in any web based language in any web application because web application needs to run in the environment of a web browser which has its own resource limitation.

所以我建议您不要在加载视图时加载所有 10000 条记录.而是先加载 1000 条记录,然后保留带有下一步"或显示更多"标签的链接或按钮,然后单击从数据库中取出下一组 1000 条记录.这样你就可以完成你的任务.

So what I would suggest is that you don't load all 10000 records at loading the view. Instead load 1000 records first and then keep a link or button with label "Next" or "Show More" like and on that click bring the next bunch of 1000 records from the database. This way you can accomplish your task.

谢谢,

吉加奥扎

这篇关于Adobe Air 中的用户登录验证和预加载器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆