如何创建“请稍候"数据导入时的微调器 [英] How to create a "Please Wait" spinner while data is being imported

查看:100
本文介绍了如何创建“请稍候"数据导入时的微调器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个Flex AIR应用程序,该应用程序将从zip文件中的数据导入到sqlite数据库中.我需要显示进度条/请稍候"微调器动画,以便用户等待直到操作完成.

I am creating an Flex AIR app which imports data from a zip file into a sqlite db. I need to show a progress bar / "Please Wait" spinner animation so that the user waits till the operation completes.

我尝试放置弹出式微调器动画,但是问题是,一旦数据库导入查询开始执行,微调器就会停止旋转.

I have tried to put a pop-up spinner animation but the problem is that the spinner stops spinning as soon as the database import queries start executing.

我需要同时而不是依次运行微调器代码和导入代码.

I need to run both the spinner code and the import code simultaneously rather than sequentially.

谢谢

推荐答案

此处遇到的问题是因为Flex是单线程应用程序.当您运行大量的as处理时,线程不会更新UI,因此您的微调器停止旋转.

The problem you are facing here is because Flex is a single threaded application. When you run large amounts of as processing, the thread does not update the UI, so your spinner stops spinning.

我认为您可以通过创建绿色线程来处理您的处理代码来解决此问题它可以切成薄片.您可以在此处中查看绿色线程"的as3实现.

I think you can work around this by creating a Green Thread to handle your processing code if it can be sliced down. You can check here for an as3 implementation of the Green Thread.

如果您需要的话,我可以提供更多有关实施的信息.

I can provide some more info on implementing it if you need.

这篇关于如何创建“请稍候"数据导入时的微调器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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