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);
}
}
Flash 8 中MovieClipLoader来监视下载
最新推荐文章于 2024-07-15 11:23:54 发布