站内搜索
分类列表
本类阅读排行
本类推荐文章
导入电影的控制
作者: 来源:互连网 点击: 日期:2008-7-18 10:54:20
_root._name = "nn";
this.onEnterFrame = function() {
if (this._name != "nn" _root.getDepth() != -16384) {
this.unloadMovie();
}
};
2,只能导入,不能直接播放
_root.onLoad = function() {
if (this._level == _level0 _parent == undefined) {
loadMovieNum("", 0);
}
};
3,导入完毕,控制电影属性,设导入电影剪辑mc中
_root.onEnterframe=function(){
if(mc._width!=0){
所设属性
}
}
4,使导入的图片在一定大小
onClipEvent (load) {
this._width=288;
this._height=209;
if(this._width>288 this._height>209){
scalew=this._width/288;
scaleh=this._height/209;
if (scalew>scaleh){
this._height=288/this._width*this._height;
this._width=288;
}else{
this._width=209/this._height*this._width;
this._height=209;
}
}
5,导入的电影无限循环播放
var jilu
function xh() {
if (mc._width != 0) {
if (mc._currentframe == jilu) {
_root.mc.gotoAndPlay(mc._currentframe+1);
}
jilu = mc._currentframe;
}
if (mc._currentframe>=mc._totalframes) {
mc.gotoAndPlay(1);
}
}
on (press) {
setInterval(_root.xh, 1000/12);
}
6,电影 的快进
var nn
function kuai() {
if (mc._width != 0 && mc._currentframe<mc._totalframes) {
nn = Math.floor(mc._totalframes/200);
mc.gotoAndStop(mc._currentframe+nn);
if ((mc._totalframes-mc._currentframe)<nn) {
mc.gotoAndStop(mc._totalframes);
}
}
}
on (press) {
setInterval(_root.kuai, 1000/12);
}
7,导入mp3的淡隐,淡出
file://soundin
function soundin() {
sound1 = setInterval(soundcontrol, 30, true);
}
file://soundout
var yy
function soundout() {
yy=1
sound1 = setInterval(soundcontrol, 30, false);
}
file://soundcontrol
var sounding
function soundcontrol(gg) {
if (mysound.getVolume()>0 && gg == false && yy == 1) {
mysound.setVolume((mysound.getVolume()-1));
} else if (mysound.getVolume()<=0 && gg == false && yy == 1) {
导入电影的控制 评论
