加载外部文件时候碰到问题load**解决方案
21视频教程网3月28日整理
this.createEmptyMovieClip("mc",this.getNestHighestDepth());
mc.loadVariables("1.txt");
//loadVariablesNum("1.txt",1)将变量加载到特定级别
gotoAndStop(mc.frame);
//gotoAndPlay(_level1.frame);
//文本内容为frame=20
stop();
stop();
this.createEmptyMovieClip("mc", this.getNestHighestDepth());
mc.loadVariables("2.txt");
//loadVariablesNum("1.txt",1)将变量加载到特定级别_level
this.onEnterFrame = function() {
if (mc.end == undefined) {
looding.text = "加载中.....";
} else {
loading.text = "加载完成";
delete this.onEnterFrame;
gotoAndStop(mc.frame);
}
};
//文本内容为frame=20&end=ok
//这里用setInterval()做循环判断也行,帮助上面有具体做法。
System.useCodepage = true;
var my_lv = new LoadVars();
my_lv.onLoad = function(success) {
if (success) {
trace("loaded!");
} else {
trace("loading");
}
};
my_lv.load("1.txt");
System.useCodepage = true;
var my_lv = new LoadVars();
my_lv.onData = function(src) {
if (src == undefined) {
trace("loading...");
} else {
a_txt.text = src;
}
};
my_lv.load("a.xml");
this.createEmptyMovieClip("loader_mc", this.getNextHighestDepth());
loader_mc.loadMovie("1001.jpg");
this.onEnterFrame = function() {
if (loader_mc.getBytesLoaded() == loader_mc.getBytesTotal()) {
loader_mc._width = 200;
loader_mc._height = 200;
delete this.onEnterFrame;
}
};
this.createEmptyMovieClip("loader_mc", this.getNextHighestDepth());
loader_mc.loadMovie("1001.jpg");
loader_mc._width = 200;
loader_mc._height = 200;
/*
loadMovieNum("1001.jpg", 1);
_level1._width = 200;
_level1._height = 300;
//这样是不行的。
*/
loadMovieNum("1001.jpg", 1);
this.onEnterFrame = function() {
if (_level1.getBytesLoaded() == _level1.getBytesTotal()&&_level1.getBytesLoaded()>0) {
_level1._x=_level1._y=50;
_level1._width = 200;
_level1._height = 300;
delete this.onEnterFrame;
}
};
this.createEmptyMovieClip("loader_mc", 1);
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
with (target_mc) {
_x = _y=20;
_width = _height=300;
}
};
var mcl:MovieClipLoader = new MovieClipLoader();
mcl.addListener(mclListener);
mcl.loadClip("1001.jpg",loader_mc);
//加载swf用mcl.loadClip("a.swf",loader_mc);
loader_mc.loadMovie("1001.jpg");
trace(loader_mc._width);//这时候输出的一定是加载前的loader_mc 的宽
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |