我想用flash8做一个动画开头,做成数字从1%到100%这种效果,该怎么做?

如题所述

在该帧as
stop();
createEmptyMovieClip("m", 1);
m.createTextField("t", 2, 200, 200, 400, 50);
m.n = 0;
m.i = 0;
tf = new TextFormat();
tf.size = 20;
tf.color = 0xff0000;
tf.align = "center";
m.t.setNewTextFormat(tf)
m.onEnterFrame = function() {
if (this.i == 3) {
this.n += 1;
this.t.text = m.n+"%";
this.i = 0;
} else {
this.i += 1;
}
};

说明
stop();
createEmptyMovieClip("m", 1);
m.createTextField("t", 2, 位置x, 位置y, 文本框宽, 文本框高);
m.n = 0;
m.i = 0;
tf = new TextFormat();
tf.size = 字体大小;
tf.color = 颜色;
tf.align = 文本位置(例子中为居中);
m.t.setNewTextFormat(tf)
m.onEnterFrame = function() {
if (this.i == 时间间隔(与帧频有关)) {
this.n += 1;
this.t.text = m.n+"%";
this.i = 0;
} else {
this.i += 1;
}
};
如果是想做加载进度就像这样
_root.stop();
stop();
createEmptyMovieClip("m", 1);
m.createTextField("t", 2, 200, 200, 400, 50);
m.n = 0;
m.i = 0;
tf = new TextFormat();
tf.size = 20;
tf.color = 0xff0000;
tf.align = "center";
m.total = _root.getBytesTotal();
m.t.setNewTextFormat(tf);
m.onEnterFrame = function() {
this.n = Math.floor(_root.getBytesLoaded()/this.total*100);
if (this.n == 100) {
_root.play();
}
this.t.text = m.n+"%";
this.i = 0;
};
温馨提示:内容为网友见解,仅供参考
第1个回答  2011-05-14
一帧一帧做做成100帧不得了。
第2个回答  2011-05-18
做逐帧动画本回答被提问者采纳
相似回答