Flash 8 中MovieClipLoader来监视下载

mc_Loader._lockroot = true;
var loadListener:Object = new Object ();
loadListener.onLoadError = function (target_mc:MovieClip, errorCode:String, httpStatus:Number) {
 trace ("errorCode: " + errorCode);
 trace ("httpStatus: " + httpStatus);
 if (errorCode == "URLNotFound") {
  sysDebug ();
 }
};
loadListener.onLoadComplete = function (target_mc:MovieClip, httpStatus:Number) {
};
loadListener.onLoadInit = function (target_mc:MovieClip) {
};
loadListener.onLoadProgress = function (target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
};
loadListener.onLoadStart = function (target_mc:MovieClip) {
};
var mcLoader:MovieClipLoader = new MovieClipLoader ();
mcLoader.addListener (loadListener);
mcLoader.loadClip ("R-050301.swf", mc_Loader);
//mcLoader.loadClip ("http://www.helpexamples.com/flash/images/image1.jpg", mc_Loader);
// building debug windows
function sysDebug ():Void {
 // static text format
 var staticTextFormat:TextFormat = new TextFormat ();
 staticTextFormat.font = "Segoe UI";
 staticTextFormat.color = 0xFFFFFF;
 // dynamic text format
 var dynamicTextFormat:TextFormat = new TextFormat ();
 dynamicTextFormat.font = "Verdana";
 //
 _root.createEmptyMovieClip ("DebugWindows", _root.getNextHighestDepth ());
 with (_root.DebugWindows) {
  // content area
  beginFill (0x669900);
  moveTo (0, 20);
  lineTo (640, 20);
  lineTo (640, 480);
  lineTo (0, 480);
  lineTo (0, 20);
  endFill ();
 }
 //
 _root.DebugWindows.createEmptyMovieClip ("DWTitle", this.getNextHighestDepth ());
 with (_root.DebugWindows.DWTitle) {
  // title area
  beginFill (0x336699);
  moveTo (0, 0);
  lineTo (640, 0);
  lineTo (640, 20);
  lineTo (0, 20);
  lineTo (0, 0);
  endFill ();
 }
 //
 _root.DebugWindows.DWTitle.createTextField ("Caption", 1, 0, 0, 640, 20);
 _root.DebugWindows.DWTitle.Caption.type = "dynamic";
 _root.DebugWindows.DWTitle.Caption.text = "DEBUG";
 _root.DebugWindows.DWTitle.Caption.selectable = false;
 _root.DebugWindows.DWTitle.Caption.setTextFormat (staticTextFormat);
 //
 _root.DebugWindows.DWTitle.onPress = function () {
  this._parent.startDrag ();
 };
 _root.DebugWindows.DWTitle.onRelease = function () {
  this._parent.stopDrag ();
 };
 //
 var sysArray:Array = new Array ("出版社", "publisher", "版本", "课序", "文件夹", "文件", "例序", "知识点");
 // create show text content
 for (var i = 0; i < sysArray.length; i++) {
  _root.DebugWindows.createTextField ("txt_" + i, i + 10, 0, 20 * (i + 1), 200, 20);
  _root.DebugWindows["txt_" + i].text = sysArray[i];
  _root.DebugWindows["txt_" + i].type = "dynamic";
  _root.DebugWindows["txt_" + i].selectable = false;
  _root.DebugWindows["txt_" + i].setTextFormat (staticTextFormat);
  _root.DebugWindows.createTextField ("dtxt_" + i, i + 30, 200, 20 * (i + 1), 200, 20);
  _root.DebugWindows["dtxt_" + i].text = sysArray[i];
  _root.DebugWindows["dtxt_" + i].type = "dynamic";
  _root.DebugWindows["dtxt_" + i].selectable = false;
  _root.DebugWindows["dtxt_" + i].setTextFormat (staticTextFormat);
 }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值