package util
{
import flash.display.DisplayObject;
import flash.events.Event;
import flash.events.FocusEvent;
import flash.events.MouseEvent;
import flash.utils.clearInterval;
import flash.utils.setInterval;
import mx.containers.Canvas;
import mx.containers.Panel;
import mx.controls.Button;
import mx.controls.Label;
import mx.controls.SWFLoader;
import mx.managers.PopUpManager;
public class LoadingUI
{
private var canvas:Canvas;
private var intervalId:uint;
/**
* 打开等待画面
*/
public function createLoading(parent:DisplayObject):void
{
canvas=new Canvas();
canvas.width=320;
canvas.height=480;
var lab:Label=new Label();
lab.text="处理中,请耐心等待1秒...";
lab.setStyle("fontSize", 14);
canvas.addChild(lab);
lab.x=85;
lab.y=180;
var loadingSwf:SWFLoader=new SWFLoader();
loadingSwf.addEventListener(Event.COMPLETE, function(event:Event):void
{
loadingSwf.stage.frameRate=12;
});
loadingSwf.source="resources/loading.swf";
loadingSwf.width=60;
loadingSwf.height=60;
canvas.addChild(loadingSwf);
loadingSwf.x=130;
loadingSwf.y=200;
PopUpManager.addPopUp(canvas, parent, true);
PopUpManager.centerPopUp(canvas);
canvas.setFocus();
canvas.addEventListener(FocusEvent.FOCUS_OUT, doFocusOut);
intervalId=setInterval(doTimeOut, 1000, lab);
}
/**
* 关闭等待画面
*/
public function destroyLoading():void
{
if (canvas == null)
{
return ;
}
clearInterval(intervalId);
canvas.removeEventListener(FocusEvent.FOCUS_OUT, doFocusOut);
PopUpManager.removePopUp(canvas);
canvas=null;
}
/**
* 等待时画面焦点始终在画板上
*/
private function doFocusOut(event:FocusEvent):void
{
event.preventDefault();
canvas.setFocus();
}
/**
* 画面秒钟定时变化
*/
private function doTimeOut():void
{
var lab:Label=arguments[0]as Label;
var tempStr:String=lab.text.substring(0, lab.text.length - 4);
var i:Number=new Number(tempStr.substring(9, tempStr.length)) + 1;
lab.text="处理中,请耐心等待" + i.toString() + "秒...";
}
}
}
分享到:
相关推荐
自定义的loading,可以代替Flex的默认loading。
Flex load源码下载,比较简单的 Flex load源码下载,比较简单的
网上找了很多都不完整,上传一个工程给大家分享,采用子类加载swf或者gif的方式显示loading ,gif或者swf文件可以随意换成自己喜欢的。如果需要百分比显示的话可能还需要修改一下代码。 ===========================...
the challenges related to managing large volumes of networked data or lazy loading that becomes important in these scenarios. Chapter 14: Facilitating Audio and Video Streaming Rich Web 2.0 ...
com.esri.ags.events Event classes for map navigation, loading layers, geoprocessing tasks and toolbars. com.esri.ags.geometry MapPoint, Multipoint, ...
flex国际化的使用示例教程,方便大学学习,共享一下!
swf格式loading动画多种,有源码。可以自将需要的样式动画弄出来,可以在FLEX中调用。
用Flex做的一个简单的相册,界面干净,感觉很清爽,而且Loading也很舒服.
com.esri.ags.events Event——classes for map navigation, loading layers, geoprocessing tasks and toolbars. com.esri.ags.geometry——MapPoint, Multipoint, Polyline, and Polygon are the main geometry...
foo { flex : 1 ; }. bar { flex : 1 1 ; }. foz { flex : 1 1 0 ; }. baz { flex : 1 1 0 px ; }输出. foo { flex : 1 1 ; }. bar { flex : 1 1 ; }. foz { flex : 1 1 ; }. baz { flex : 1 1 ; }错误输入. foo { ...
React本机加载 ... flex: 1, "center" 目的 浮动视图容器的样式对象 用法 import FrameLoading from "react-native-frame-loading" import Icon from "react-native-vector-icons/FontAwesome" const
运用了css变量的知识,直接上代码及其我加的注释 <!DOCTYPE html> <html> <head> <meta charset="utf-8">... .flex { display: flex;... .loading { width: 200px; height
可以进行修改的网站loading源文件,简单的样式,金属质感。
- FIX: When the curve contain more then one figure and they were all unconfined and curve have alternative brush then whole flex-object bounding rectangle was filed. - FIX: The MaskColor property ...
这是一个flash源文件,效果很好,测试平台为flash 8.0(如果提示问题请选择合适的版本试试),代码的效果是:色彩loading效果
Loading configuration file C:\Flex\frameworks\flex-config.xml C:\Flex\bin\Crossdomain.swf (535802 bytes) 该脚本需要一个指向易受攻击站点的url参数,即: : url = : BrowserCookies.as 和 Index.as:用 ...
基于 Vue(2.5) + vuex + vue-router + vue-axios +better-scroll + Scss + ES6 等开发一款移动端音乐 WebApp,UI 界面参考了安卓版的网易云音乐、flex 布局适配常见移动端。通过学习开发一个 Vue 全家桶项目,让自己...
<loading hidden="{{hidden}}" bindchange="loadingChange"> 加载中... </loading> ;" bindscrolltolower="loadMore" bindscrolltoupper="refesh"> <view wx:if="{{hasRefesh}}" style="display: flex;flex-...
open flash chart 2 的swc文件包 可以在flex里面调用了. [Bindable] private var chart:String='{ "elements": [ { "type": "bar","alpha":0.8,"colour":"#663366", "values": [ 0 ] } ], "title": { "text": "...
Loading 效果 图片 3D 分层悬浮效果 搜索框 社交媒体按钮 悬浮照片效果 FloatPhoto.html 自适应布局导航 FlexLayout.html FlexLayout.html 自适应相册 FlexAlbum.html FlexAlbum.html 自适应 UI 设计 FlexCard.html ...