FLASH播放器部分源代码解说

来源:百度知道 编辑:UC知道 时间:2024/07/04 23:29:49
希望能帮我谢谢各位
var ti:Number;
function showTip(datext) {
ti = getTimer();
main.tooltip.datext.text = datext;
main.tooltip.onEnterFrame = function() {
var tempti = getTimer();
if (tempti-ti>500) {
this._x = Math.round(main._xmouse);
this._y = Math.round(main._ymouse);
main.tooltip._visible = true;
}
};
}
function removeTip() {
main.tooltip._visible = false;
delete main.tooltip.onEnterFrame;
}
main.tooltip._visible = false;
main.mute.onRelease = function() {
if (sou.getVolume() == 0) {
sou.setVolume(myVolume);
cb.vol._x = 544+63*myVolume/100;
} else {
myVolume = sou.getVolume();
sou.setVolume(0);
cb.vol._x = 544;
}
main.bugle.play();
};
main.mute.onRollOver = function() {
showTip("Toggle Mute");
};
main.mute.onRollOut = function() {
removeTip();
};

//dragging <

//var ti:Number;
function showTip(datext) { //定义showtip函数 用来显示与解释 按钮的功能
ti = getTimer(); // 自 SWF 文件开始播放时起已经过的毫秒数
main.tooltip.datext.text = datext; //当此函数被调用时,把获的的变量datext赋给tootlip文本
main.tooltip.onEnterFrame = function() {
//var tempti = getTimer();
//if (//tempti-ti<500) {
this._x = Math.round(main._xmouse); //确定tooltip出现在鼠标附近
this._y = Math.round(main._ymouse);
main.tooltip._visible = true;//}
};}
function removeTip() { //定义removetip()函数,
main.tooltip._visible = false;
delete main.tooltip.onEnterFrame; //删除main.tooltip.onEnterFrame 相当于隐藏tooltip
}
main.tooltip._visible = false;
main.mute.onRelease = function() { //利用mute控制声音
if (sou.getVolume() == 0) {
sou.setVolume(myVolume);
cb.vol._x = 544+55*myVolume/100; //控制声音条vol 复原到有声音时