为了保障原创作者在本站发表文章的利益, 并维护本站原创的精神, 特声明: RIAShanghai对有以下任何情况之一的文章将不通知作者并直接进行快意删除:
- 非原创, 或者原创但一文多发;
- 各种形式的广告与吹擂;
- 不符合本站文章格式.
欢迎各位读者监督. 谢谢合作. 另: 作为Adobe正式的UG, 我们将把Adobe不定期分发的软件,书籍及各种纪念品赠送给发文活跃的作者, 共同进步.
This article gives ideas for developing loading screens for Flex applications. The loading sequence for a typical RIA application could be:
[0. Downloading the runtime binary] -> [1. Application initializing] -> [2. Application started]
For Flex/flash application, the preloader will be displayed at step 0. At step 1, application is running and it's up the application to display any loading screen. One of our RIA app needs to load metadata from server thus we do need a loading screen at step 1.
If you use two very different loading screens for step 0 and step 1, the end users will get confused. So use identical screens or similar enough that users hardly notice the difference. It's easy to say, but it requires considerable effort to implement. The difficulty comes from the fact that Flex is not running in step 0 yet but running in step 1 - you can only use Flash sprites in step 0 while you can use whatever Flex components in step 1.
Due to lack of experience with Flash sprite, I run into a lot of troubles. Here's one lesson: do not set size or position sprites unless it's absolutely necessary; otherwise you'll got zoomed or missed sprites. I managed to have two version of the loading screen: a Flex version and its Flash counterpart using sprites.
I use Flash version to implement the preloader for step 0 and display the Flex version for step 1. Below are their screen shots respectively:
- If you are developing a step 0 preloader for a large application: create a light testing Flex application and develop the preloader at this small application - you may like code folders from the large application.
- Use SwfRrefreshFilter and set the send delay to 5 seconds or higher to have a grace period for testing loading:
<init-param>
<param-name>send-delay-seconds</param-name>
<param-value>5</param-value>
</init-param>
When you are done, set send delay to 0.
- Use ANT to compile and build when you develop an application targeting both AIR and browsers.
- To code preloader, refer to LW's Flex 预载界面美化 Flex's preloader is not so flex.