- 浏览: 77303 次
- 性别:
- 来自: 大连
最新评论
http://www.pixelbox.net/demos/downloadProgressBar/MyDownloadProgressBar.as
package com.example.preloaders
{
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.events.TimerEvent;
import flash.geom.Rectangle;
import flash.net.URLRequest;
import flash.text.TextField;
import flash.utils.Timer;
import flash.utils.getTimer;
import mx.events.FlexEvent;
import mx.preloaders.IPreloaderDisplay;
public class MyDownloadProgressBar extends Sprite implements IPreloaderDisplay
{
// Settings fiddle with these as you like
private var _minimumDuration:Number = 3000; // even if the preloader is done, take this long to "finish"
// Implementation variables, used to make everything work properly
private var _IsInitComplete : Boolean = false;
private var _timer : Timer; // this is so we can redraw the progress bar
private var _bytesLoaded : uint = 0;
private var _bytesExpected : uint = 1; // we start at 1 to avoid division by zero errors.
private var _fractionLoaded : Number = 0; // Will be used for the width of the loading bar
private var _preloader : Sprite;
private var _currentStatus : String; // The current stats of the application, downloaded, initilising etc
// Display properties of the loader, these are set in the mx:Application tag
private var _backgroundColor : uint = 0x000000;
private var _stageHeight : Number = 1;
private var _stageWidth : Number = 1;
private var _loadingBarColour : uint = 0x3ea1ee;
// Display elements
private var _loadingBar : Rectangle; // The loading bar that will be drawn
private var loadingImage : flash.display.Loader;
private var progressText : TextField;
private var statusText : TextField;
public function MyDownloadProgressBar()
{
super();
}
// Called when the appication is ready for the preloading screen
public function initialize():void
{
drawBackground();
// Load in your logo or loading image
loadingImage = new flash.display.Loader();
loadingImage.contentLoaderInfo.addEventListener( Event.COMPLETE, loader_completeHandler);
loadingImage.load(new URLRequest("../assets/loadingLogo.jpg")); // This path needs to be relative to your swf on the server, you could use an absolute value if you are unsure
}
private function loader_completeHandler(event:Event):void
{
// At this stage we are sure the image has loaded so we can start drawing the progress bar and other info
// Draw the loading image
addChild(loadingImage);
loadingImage.width = 200;
loadingImage.height= 100;
loadingImage.x = 400;
loadingImage.y = 200;
// Draw your loading bar in it's full state - x,y,width,height
_loadingBar = new Rectangle(400, 300, 200, 10);
// Create a text area for your progress text
progressText = new TextField();
progressText.x = 400;
progressText.y = 310;
progressText.width = 200;
progressText.height = 20;
progressText.textColor = 0x3ea1ee;
addChild(progressText);
// Create a text area for your status text
statusText = new TextField();
statusText.x = 400;
statusText.y = 320;
statusText.width = 200;
statusText.height = 20;
statusText.textColor = 0x3ea1ee;
addChild(statusText);
// The first change to this var will be Download Complete
_currentStatus = 'Downloading';
// Start a timer to redraw your loading elements frequently
_timer = new Timer(50);
_timer.addEventListener(TimerEvent.TIMER, timerHandler);
_timer.start();
}
// This is called repeatidly untill we are finished loading
private function draw():void
{
graphics.beginFill( _loadingBarColour , 1);
graphics.drawRect(_loadingBar.x, _loadingBar.y, _loadingBar.width * _fractionLoaded, _loadingBar.height);
graphics.endFill();
progressText.text = (Math.round(_bytesLoaded / 1024)).toString() + 'KB of ' + (Math.round(_bytesExpected / 1024)) + 'KB downloaded';
statusText.text = _currentStatus;
}
private function drawBackground():void
{
// Draw the background using the background colour (set in the mx:Application MXML tag)
graphics.beginFill( _backgroundColor, 1);
graphics.drawRect( 0, 0, stageWidth, stageHeight);
graphics.endFill();
}
// This code comes from DownloadProgressBar. I have modified it to remove some unused event handlers.
public function set preloader(value:Sprite):void
{
_preloader = value;
value.addEventListener(ProgressEvent.PROGRESS, progressHandler);
value.addEventListener(Event.COMPLETE, completeHandler);
// value.addEventListener(RSLEvent.RSL_PROGRESS, rslProgressHandler);
// value.addEventListener(RSLEvent.RSL_COMPLETE, rslCompleteHandler);
// value.addEventListener(RSLEvent.RSL_ERROR, rslErrorHandler);
value.addEventListener(FlexEvent.INIT_PROGRESS, initProgressHandler);
value.addEventListener(FlexEvent.INIT_COMPLETE, initCompleteHandler);
}
// Getters and setters for values, most are set via the MXML in the mx:Application tag
public function set backgroundAlpha(alpha:Number):void{}
public function get backgroundAlpha():Number { return 1; }
public function set backgroundColor(color:uint):void { _backgroundColor = color; }
public function get backgroundColor():uint { return _backgroundColor; }
public function set backgroundImage(image:Object):void {}
public function get backgroundImage():Object { return null; }
public function set backgroundSize(size:String):void {}
public function get backgroundSize():String { return "auto"; }
public function set stageHeight(height:Number):void { _stageHeight = height; }
public function get stageHeight():Number { return _stageHeight; }
public function set stageWidth(width:Number):void { _stageWidth = width; }
public function get stageWidth():Number { return _stageWidth; }
//--------------------------------------------------------------------------
//
// Event handlers
//
//--------------------------------------------------------------------------
// Called by the application as the download progresses.
private function progressHandler(event:ProgressEvent):void
{
_bytesLoaded = event.bytesLoaded;
_bytesExpected = event.bytesTotal;
_fractionLoaded = Number(_bytesLoaded) / Number(_bytesExpected);
}
// Called when the download is complete
private function completeHandler(event:Event):void
{
_currentStatus = 'Download Completed';
trace(_currentStatus);
}
// Called by the application as the initilisation progresses.
private function initProgressHandler(event:Event):void
{
if( !_IsInitComplete) // This seems to be called right at the end for some reason, so this stopps it if the app is already complete
{
_currentStatus = 'Initilising Application';
trace(_currentStatus);
}
}
// Called when both download and initialisation are complete
private function initCompleteHandler(event:Event):void
{
_currentStatus = 'Initilisation Completed';
trace(_currentStatus);
_IsInitComplete = true;
}
// Called as often as possible
private function timerHandler(event:Event):void
{
if ( _IsInitComplete && getTimer() > _minimumDuration )
{
// Everything is now ready, so we can tell the application to show the main application
// NOTE: If you have set a min duration, your application may already have started running
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER,timerHandler);
dispatchEvent(new Event(Event.COMPLETE));
}
else
{
// Update the screen with the latest progress
draw();
}
}
}
}
package com.example.preloaders
{
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.events.TimerEvent;
import flash.geom.Rectangle;
import flash.net.URLRequest;
import flash.text.TextField;
import flash.utils.Timer;
import flash.utils.getTimer;
import mx.events.FlexEvent;
import mx.preloaders.IPreloaderDisplay;
public class MyDownloadProgressBar extends Sprite implements IPreloaderDisplay
{
// Settings fiddle with these as you like
private var _minimumDuration:Number = 3000; // even if the preloader is done, take this long to "finish"
// Implementation variables, used to make everything work properly
private var _IsInitComplete : Boolean = false;
private var _timer : Timer; // this is so we can redraw the progress bar
private var _bytesLoaded : uint = 0;
private var _bytesExpected : uint = 1; // we start at 1 to avoid division by zero errors.
private var _fractionLoaded : Number = 0; // Will be used for the width of the loading bar
private var _preloader : Sprite;
private var _currentStatus : String; // The current stats of the application, downloaded, initilising etc
// Display properties of the loader, these are set in the mx:Application tag
private var _backgroundColor : uint = 0x000000;
private var _stageHeight : Number = 1;
private var _stageWidth : Number = 1;
private var _loadingBarColour : uint = 0x3ea1ee;
// Display elements
private var _loadingBar : Rectangle; // The loading bar that will be drawn
private var loadingImage : flash.display.Loader;
private var progressText : TextField;
private var statusText : TextField;
public function MyDownloadProgressBar()
{
super();
}
// Called when the appication is ready for the preloading screen
public function initialize():void
{
drawBackground();
// Load in your logo or loading image
loadingImage = new flash.display.Loader();
loadingImage.contentLoaderInfo.addEventListener( Event.COMPLETE, loader_completeHandler);
loadingImage.load(new URLRequest("../assets/loadingLogo.jpg")); // This path needs to be relative to your swf on the server, you could use an absolute value if you are unsure
}
private function loader_completeHandler(event:Event):void
{
// At this stage we are sure the image has loaded so we can start drawing the progress bar and other info
// Draw the loading image
addChild(loadingImage);
loadingImage.width = 200;
loadingImage.height= 100;
loadingImage.x = 400;
loadingImage.y = 200;
// Draw your loading bar in it's full state - x,y,width,height
_loadingBar = new Rectangle(400, 300, 200, 10);
// Create a text area for your progress text
progressText = new TextField();
progressText.x = 400;
progressText.y = 310;
progressText.width = 200;
progressText.height = 20;
progressText.textColor = 0x3ea1ee;
addChild(progressText);
// Create a text area for your status text
statusText = new TextField();
statusText.x = 400;
statusText.y = 320;
statusText.width = 200;
statusText.height = 20;
statusText.textColor = 0x3ea1ee;
addChild(statusText);
// The first change to this var will be Download Complete
_currentStatus = 'Downloading';
// Start a timer to redraw your loading elements frequently
_timer = new Timer(50);
_timer.addEventListener(TimerEvent.TIMER, timerHandler);
_timer.start();
}
// This is called repeatidly untill we are finished loading
private function draw():void
{
graphics.beginFill( _loadingBarColour , 1);
graphics.drawRect(_loadingBar.x, _loadingBar.y, _loadingBar.width * _fractionLoaded, _loadingBar.height);
graphics.endFill();
progressText.text = (Math.round(_bytesLoaded / 1024)).toString() + 'KB of ' + (Math.round(_bytesExpected / 1024)) + 'KB downloaded';
statusText.text = _currentStatus;
}
private function drawBackground():void
{
// Draw the background using the background colour (set in the mx:Application MXML tag)
graphics.beginFill( _backgroundColor, 1);
graphics.drawRect( 0, 0, stageWidth, stageHeight);
graphics.endFill();
}
// This code comes from DownloadProgressBar. I have modified it to remove some unused event handlers.
public function set preloader(value:Sprite):void
{
_preloader = value;
value.addEventListener(ProgressEvent.PROGRESS, progressHandler);
value.addEventListener(Event.COMPLETE, completeHandler);
// value.addEventListener(RSLEvent.RSL_PROGRESS, rslProgressHandler);
// value.addEventListener(RSLEvent.RSL_COMPLETE, rslCompleteHandler);
// value.addEventListener(RSLEvent.RSL_ERROR, rslErrorHandler);
value.addEventListener(FlexEvent.INIT_PROGRESS, initProgressHandler);
value.addEventListener(FlexEvent.INIT_COMPLETE, initCompleteHandler);
}
// Getters and setters for values, most are set via the MXML in the mx:Application tag
public function set backgroundAlpha(alpha:Number):void{}
public function get backgroundAlpha():Number { return 1; }
public function set backgroundColor(color:uint):void { _backgroundColor = color; }
public function get backgroundColor():uint { return _backgroundColor; }
public function set backgroundImage(image:Object):void {}
public function get backgroundImage():Object { return null; }
public function set backgroundSize(size:String):void {}
public function get backgroundSize():String { return "auto"; }
public function set stageHeight(height:Number):void { _stageHeight = height; }
public function get stageHeight():Number { return _stageHeight; }
public function set stageWidth(width:Number):void { _stageWidth = width; }
public function get stageWidth():Number { return _stageWidth; }
//--------------------------------------------------------------------------
//
// Event handlers
//
//--------------------------------------------------------------------------
// Called by the application as the download progresses.
private function progressHandler(event:ProgressEvent):void
{
_bytesLoaded = event.bytesLoaded;
_bytesExpected = event.bytesTotal;
_fractionLoaded = Number(_bytesLoaded) / Number(_bytesExpected);
}
// Called when the download is complete
private function completeHandler(event:Event):void
{
_currentStatus = 'Download Completed';
trace(_currentStatus);
}
// Called by the application as the initilisation progresses.
private function initProgressHandler(event:Event):void
{
if( !_IsInitComplete) // This seems to be called right at the end for some reason, so this stopps it if the app is already complete
{
_currentStatus = 'Initilising Application';
trace(_currentStatus);
}
}
// Called when both download and initialisation are complete
private function initCompleteHandler(event:Event):void
{
_currentStatus = 'Initilisation Completed';
trace(_currentStatus);
_IsInitComplete = true;
}
// Called as often as possible
private function timerHandler(event:Event):void
{
if ( _IsInitComplete && getTimer() > _minimumDuration )
{
// Everything is now ready, so we can tell the application to show the main application
// NOTE: If you have set a min duration, your application may already have started running
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER,timerHandler);
dispatchEvent(new Event(Event.COMPLETE));
}
else
{
// Update the screen with the latest progress
draw();
}
}
}
}
相关推荐
声发射定位算法 Matlab 仿真项目源码+文档说明(高分项目),含有代码注释,新手也可看懂,个人手打98分项目,导师非常认可的高分项目,毕业设计、期末大作业和课程设计高分必看,下载下来,简单部署,就可以使用。该项目可以直接作为毕设、期末大作业使用,代码都在里面,系统功能完善、界面美观、操作简单、功能齐全、管理便捷,具有很高的实际应用价值,项目都经过严格调试,确保可以运行! 声发射定位算法 Matlab 仿真项目源码+文档说明(高分项目)声发射定位算法 Matlab 仿真项目源码+文档说明(高分项目)声发射定位算法 Matlab 仿真项目源码+文档说明(高分项目)声发射定位算法 Matlab 仿真项目源码+文档说明(高分项目)声发射定位算法 Matlab 仿真项目源码+文档说明(高分项目)声发射定位算法 Matlab 仿真项目源码+文档说明(高分项目)声发射定位算法 Matlab 仿真项目源码+文档说明(高分项目)声发射定位算法 Matlab 仿真项目源码+文档说明(高分项目)声发射定位算法 Matlab 仿真项目源码+文档说明(高分项目)声发射定位算法 Matlab 仿真项目源码+
monkey测试,推包文件
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 替换数据可以直接使用,注释清楚,适合新手
一、项目简介 本项目是一套基于JavaWeb电子商城,主要针对计算机相关专业的正在做毕设的学生与需要项目实战练习的Java学习者。 包含:项目源码、数据库脚本等,该项目附带全部源码可作为毕设使用。 项目都经过严格调试,eclipse 确保可以运行! 该系统功能完善、界面美观、操作简单、功能齐全、管理便捷,具有很高的实际应用价值 二、技术实现 jsp+servlet+mysql 三、开发运行环境 jdk1.8 Tomcat8及其以上版本 Mysql5.5及以上版本 四、系统功能 首页 销售排行 新品上架 特价商品 查看订单 购物车 会员修改 加入购物车 继续购物 去收银台结账 清空购物车 修改数量等功能 详情 https://blog.csdn.net/weixin_43860634/article/details/130983090
计算机图形学之动画和模拟算法:CrowdSimulation:碰撞检测与响应.docx
LOL v2数据集,train和test
logistic regression.ipynb
2G+16G主程序物料号11173101 AML-962H机芯升级步骤 本地升级: 1、将2G+xG_update.zip重命名update.zip,拷贝至U盘,插入电视USB,打开电视进入设置 2、选择本地升级,升级完毕后电视会重启,操作过程中切勿断电关机 升级完成后可以在系统设置——本机信息——查询软件版本 强制升级: 1、解压强制升级脚本recovery.img与factory_update_param.aml,加上update.zip三个文件拷贝至U盘根目录,插入电视USB 2、插拔下电源,按遥控器待机键后快速不停点按遥控器右键5-10下触发主板识别U盘软件进行升级 3、升级完毕后电视会重启,操作过程中切勿断电关机 串口升级 1、将三个升级软件拷贝至U盘根目录下,然后插入电视的USB接口 2、电视开启的时候按住电脑键盘Enter回车键出现txl_p392_v1#时,输入run update敲回车,系统识别U盘软件进行升级 如未成功先确认输入指令是否正常,reboot重新启动再试 若还是无法升级可能是硬件存储系统的EMMC模块损坏,请更换主板
用于Excel下载测试
【作品名称】:基于C++实现数字图像处理和深度学习的车牌定位,字符分割和字符识别项目,包含项目收集数据集和cnn模型(含源码+论文) 【适用人群】:适用于希望学习不同技术领域的小白或进阶学习者。可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。 【项目介绍】: 该项目以数字图像处理和机器学习为基础,以1485张图片组成的原始数据集为出发点,研究了如何从原始图片集中得到用于分类器训练的数据集;针对车牌区域特点和输入图片的全局特点,提出了四种不同的可能的车牌区域提取方法,经过校正后得到车牌区域候选人;参考自然场景下的文本检测方法和车牌中的字符分布特点,对车牌候选区域提取改进的最大稳定极值区域,通过使用非极大值抑制和区域校正得到字符候选人,通过字符判断分类器和字符搜索,实现非车牌区域的滤除和车牌区域7个字符的提取,其中字符判断使用基于20个描述性特征的支持向量机实现;通过使用金字塔梯度方向直方图特征得到了用于 【资源声明】:本资源作为“参考资料”而不是“定制需求”,代码只能作为参考,不能完全复制照搬。需要有一定的基础看懂代码,自行调试代码并解决报错,能自行添加功能修改代码。
包括了全部的资源文(图标ico)和源代码
机器学习20241106-5
项目经过测试均可完美运行! 环境说明: 开发语言:java jdk:jdk1.8 数据库:mysql 5.7+ 数据库工具:Navicat11+ 管理工具:maven 开发工具:idea/eclipse
有图有真相
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 替换数据可以直接使用,注释清楚,适合新手
项目经过测试均可完美运行! 环境说明: 开发语言:java jdk:jdk1.8 数据库:mysql 5.7+ 数据库工具:Navicat11+ 管理工具:maven 开发工具:idea/eclipse
项目经过测试均可完美运行! 环境说明: 开发语言:java jdk:jdk1.8 数据库:mysql 5.7+ 数据库工具:Navicat11+ 管理工具:maven 开发工具:idea/eclipse
springboot253基于Springboot+Vue社区养老服务系统-毕业源码案例设计 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。
【作品名称】:飞思卡尔智能车平台,基于 python+CNN实现识别道路图像类型,图像处理计算轨迹线 【适用人群】:适用于希望学习不同技术领域的小白或进阶学习者。可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。 【项目介绍】:飞思卡尔智能车平台,CNN识别道路图像类型,图像处理计算轨迹线 飞思卡尔智能车平台,基于 python+CNN实现识别道路图像类型,图像处理计算轨迹线 飞思卡尔智能车平台,基于 python+CNN实现识别道路图像类型,图像处理计算轨迹线 【资源声明】:本资源作为“参考资料”而不是“定制需求”,代码只能作为参考,不能完全复制照搬。需要有一定的基础看懂代码,自行调试代码并解决报错,能自行添加功能修改代码。
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 替换数据可以直接使用,注释清楚,适合新手