[Actionscript][Away3D]三维图片展示Demo
2009-03-03 11:58:46 来源:WEB开发网Loader文档类:
1package {
2 /**//**
3 * author: Aken li (http://www.kxbd.com)
4 * date: 2009-03-03
5 */
6 import flash.display.*;
7 import flash.events.*;
8 import flash.net.URLRequest;
9 import flash.text.*;
10
11 public class loader extends Sprite {
12 private var loadingText:TextField;
13 private var loadingUrl:String = 'Num08.swf';
14 private var myLoader:Loader;
15
16 public function loader() {
17 makeText();
18 makeLoader();
19 }
20
21 private function makeLoader() {
22 myLoader = new Loader();
23 myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadingProcess);
24 myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded);
25 myLoader.load(new URLRequest(loadingUrl));
26 addChild(myLoader);
27 }
28
29 private function loadingProcess(e:ProgressEvent) {
30 var loadedPercent = Math.round(100 * e.bytesLoaded / e.bytesTotal);
31 loadingText.text = 'loaded ' + loadedPercent + '%';
32 }
33
34 private function loaded(e:Event) {
35 removeChild(loadingText);
36 loadingText = null;
37 }
38
39 private function makeText() {
40 var textFormat:TextFormat = new TextFormat();
41 textFormat.color = 0xFFFFFF;
42 loadingText = new TextField();
43 loadingText.x = stage.stageWidth/2-20;
44 loadingText.y = 10;
45 addChild(loadingText);
46 loadingText.defaultTextFormat = textFormat;
47 }
48 }
49
50}
Tags:Actionscript AwayD 三维
编辑录入:爽爽 [复制链接] [打 印]- ››ActionScript 2.0中的! 逻辑 NOT 运算符
- ››ActionScript 3.0 性能方面优化小知识整理收集
- ››ActionScript中文本字段的透明度缓动
- ››ActionScript 3.0 Step By Step系列(一):工欲其善...
- ››ActionScript 3.0 Step By Step系列(二):建立扎实...
- ››ActionScript 3.0 Step By Step系列(三):学学流程...
- ››ActionScript 3.0 Step By Step系列(四):来自面向...
- ››ActionScript 3.0 Step By Step系列(五):走在面向...
- ››ActionScript 3.0 Step By Step系列(六):学对象事...
- ››ActionScript 3.0 Step By Step系列(七):使用XML...
- ››ActionScript 3.0 Step By Step系列(八):动态的数...
- ››ActionScript 3.0 Step By Step系列(九):使用样式...
更多精彩
赞助商链接