免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
flash影片web播放控制器制作祥解
flash影片web播放控制器制作祥解(類似閃吧flash播放器)

演示:http://www.wren.cn/flash/ 點(diǎn)擊其中的flash連接就可以看到。
在閃吧看到了這個(gè)flash播放器,想下載其源碼下來研究已供自己使用,沒想到閃吧已做禁止下載功能。費(fèi)了幾天的網(wǎng)上搜索,除了幾篇相關(guān)資料外,沒有源碼下載,更沒有實(shí)例講解。受不住誘惑,只好自己參考資料親手寫了。這個(gè)flash影片播放控制器時(shí)用了閃吧的播放界面,程序代碼完全親手寫上。
首先我們看看flash播放控制器的界面(很簡單的html代碼,不過不是自己源創(chuàng)的) 定義樣式:

<style>
body,td,button{font:normal 12px Tahoma;color:#333333;text-align:center}
.drag{position:relative;cursor:hand}
button{border:1px solid #333333;background:#EEEEEE;margin:2px;font-family:Webdings;height:20px}
div{cursor:default}
#menu{margin:3;line-height:20px;border:1px solid #dedede;background:#FFFFFF;display:none;position:absolute}
#menu a:link,a:visited{border:1px solid #FFFFFF;background:#FFFFFF;text-decoration:none;display:block;padding:0 3;margin:1;color:#333333;cursor:default;text-align:left;text-indent:15px}
#menu a:hover{background:#dedede;border-color:#666666;color:#000000}
#ctlButtons IMG{behavior:url(rollover.htc)}
</style>
引用驅(qū)動(dòng)程序:
<script src="play.js"></script>
以下是flash影片播放和控制界面代碼:
<div oncontextmenu="return false" onselectstart="return false">
<div style="padding:0">
<table border="0" cellpadding="0" cellspacing="1" bgcolor="#000000"><tr><td>
<object id="movie" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase= "http://download.macromedia.com/pub/ shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550" height="400" align="middle">
<param name="movie" value="about:blank" />
<param name="quality" value="high" />
</object>
</td></tr></table>

<table style="width:550px;height:35px;vertical-align:bottom" cellspacing="0" cellpadding="0" border="0">
<tr>
<td style="">
<table style="border:0px solid #333333;width:90%;" cellpadding="1" cellspacing="0">
<tr>
<td style="text-align:left;vertical-align:left;background:url(bg.gif);height:8px" onMouseDown="Jump(total*event.offsetX/421|0)">
<div id="bar" style="width:0%;font:3px;height:3px;background:#00FF44"></div>
</td>
<tr>
</table>
</td>
<td style="text-align:right;width:50px;font:11px Tahoma" id="frameCount"></td>
</tr>
</table>
<span id="ctlButtons">
<img onClick="Rewind();" title="跳至第一幀" text="9" src="images/button/dd1.gif" hoverSrc="images/button/hh1.gif">
<img onClick="Back();" title="快退" text="7" src="images/button/dd2.gif" hoverSrc="images/button/hh2.gif">
<img onClick="Play();" title="播放" text="4" src="images/button/dd3.gif" hoverSrc="images/button/hh3.gif">
<img onClick="Pause();" title="暫停" text=";" src="images/button/dd4.gif" hoverSrc="images/button/hh4.gif">
<img onClick="Stop();" title="停止" text="<" src="images/button/dd5.gif" hoverSrc="images/button/hh5.gif">
<img onClick="Forward();" title="快進(jìn)" text="8" src="images/button/dd6.gif" hoverSrc="images/button/hh6.gif">
<img onClick="GoToEnd();" title="跳至最末幀" text=":" src="images/button/dd7.gif" hoverSrc="images/button/hh7.gif">
<img onClick="Replay();" title="重放" text="q" src="images/button/dd8.gif" hoverSrc="images/button/hh8.gif">
<img onClick="showMenu(menu);" title="打開 Flash 文件" text="5" src="images/button/dd9.gif" hoverSrc="images/button/hh9.gif">
<input type="file" id="moviefile" style="display:none" onpropertychange="loadMovie()"></span>
<div id="menu" onClick="this.style.display=''''''''none''''''''">
<a href="打開指定URL" onClick="OpenRemoteSwf();return false">打開指定URL</a>
<a href="選擇本地文件" onClick="selectMovie();return false">選擇本地文件</a>
<a href="選擇本地文件" onClick="alert(''''''''Wren FLash Player 1.0 Preview\nCopyright (C) WRen.Cn'''''''');return false">關(guān)于Wren Flash Player</a>
</div></div>
運(yùn)行播放器的驅(qū)動(dòng)程序:
<script defer>
var movie=document.getElementById("movie");
loadSWF("http://down.wren.cn/flash/navigation_68.swf","600","400"); //loadSWF("flash地址","寬度","高度")
</script>

下面看看我寫的驅(qū)動(dòng)程序代碼,保存為play.js:
var total;//定義flash影片總楨數(shù)
var frame_number;//定義flash影片當(dāng)前楨數(shù)

//以下是滾動(dòng)條圖片拖動(dòng)程序
var dragapproved=false;
var z,x,y
//移動(dòng)函數(shù)
function move(){
if (event.button==1&&dragapproved){
y=temp1+event.clientX-x;
//以下是控制移動(dòng)的范圍
if(y<0)
y=0;
if(y>420)
y=420;

z.style.pixelLeft=y
movie.GotoFrame(y/420*total);//移動(dòng)到某一位置,flash影片播放到某個(gè)位置
return false
}
}
//獲得拖動(dòng)前初始數(shù)據(jù)的函數(shù)
function drags(){
if (!document.all)
return
if (event.srcElement.className=="drag"){
dragapproved=true
z=event.srcElement
temp1=z.style.pixelLeft
x=event.clientX
document.onmousemove=move
}
}

//動(dòng)態(tài)顯示播放影片的當(dāng)前楨/總楨數(shù)
function showcount(){
frame_number=movie.CurrentFrame();
frame_number++;
frameCount.innerText=frame_number+"/"+movie.TotalFrames;
element.style.pixelLeft=420*(frame_number/movie.TotalFrames);//滾動(dòng)條圖片隨之到相應(yīng)的位置
if(frame_number==movie.TotalFrames)
clearTimeout(tn_ID);
else
var tn_ID=setTimeout(''''''''showcount();'''''''',1000);
}
//使影片返回第一幀
function Rewind(){
if(movie.IsPlaying()){
Pause();
}
movie.Rewind();
element.style.pixelLeft=0;
frameCount.innerText="1/"+total;
}
//播放影片
function Play(){
movie.Play();
showcount();
}
//暫停播放
function Pause(){
movie.StopPlay();
}

//跳至最末幀
function GoToEnd(){
if(movie.IsPlaying())
Pause();
movie.GotoFrame(total);
element.style.pixelLeft=420;
frameCount.innerText=total+"/"+total;
}
//快退影片
function Back()
{
if(movie.IsPlaying())
Pause();
frame_number=frame_number-50;
movie.GotoFrame(frame_number);
Play();
}
//快進(jìn)影片
function Forward()
{
if(movie.IsPlaying())
Pause();
frame_number=frame_number+50;
movie.GotoFrame(frame_number);
Play();
}
//重新播放影片
function Replay(){
if(movie.IsPlaying()){
Pause();
movie.Rewind();
Play();
}
else
{
movie.Rewind();
Play();
}
}
//停止播放影片返回到第一楨
function Stop(){
if(movie.IsPlaying()){
Pause();
movie.Rewind();
}
else
{
movie.Rewind();
}
}
//顯示影片載入進(jìn)度,完全載入后控制按鈕可用
function jindu(){
var in_ID;
bar.style.width=Math.round(movie.PercentLoaded())+"%";
frameCount.innerText=Math.round(movie.PercentLoaded())+"%";
if(movie.PercentLoaded() == 100){
ctlButtons.document.all.tags(''''''''IMG'''''''')[0].disabled=false;
ctlButtons.document.all.tags(''''''''IMG'''''''')[1].disabled=false;
ctlButtons.document.all.tags(''''''''IMG'''''''')[2].disabled=false;
ctlButtons.document.all.tags(''''''''IMG'''''''')[3].disabled=false;
ctlButtons.document.all.tags(''''''''IMG'''''''')[4].disabled=false;
ctlButtons.document.all.tags(''''''''IMG'''''''')[5].disabled=false;
ctlButtons.document.all.tags(''''''''IMG'''''''')[6].disabled=false;
ctlButtons.document.all.tags(''''''''IMG'''''''')[7].disabled=false;
ctlButtons.document.all.tags(''''''''IMG'''''''')[8].disabled=false;
total=movie.TotalFrames;
frame_number++;
frameCount.innerText=frame_number+"/"+total;
bar.style.background="";
//bar.style.width="0%"
bar.innerHTML=''''''''<img src="images/button/posbar1.gif" style="cursor:hand;border:0;" id="element" class="drag" OnMouseOver="fnOnMouseOver()" OnMouseOut="fnOnMouseOut()">'''''''';
document.onmousedown=drags
document.onmouseup=new Function("dragapproved=false;Play()")
showcount();
clearTimeout(in_ID);
}
else
in_ID=setTimeout("jindu();",1000);
}

//開始載入flash影片,載入過程中,播放控制按鈕不可用
function loadSWF(fsrc,fwidth,fheight){
movie.LoadMovie(0, fsrc);
movie.width=fwidth;
movie.height=fheight;
ctlButtons.document.all.tags(''''''''IMG'''''''')[0].disabled=true;
ctlButtons.document.all.tags(''''''''IMG'''''''')[1].disabled=true;
ctlButtons.document.all.tags(''''''''IMG'''''''')[2].disabled=true;
ctlButtons.document.all.tags(''''''''IMG'''''''')[3].disabled=true;
ctlButtons.document.all.tags(''''''''IMG'''''''')[4].disabled=true;
ctlButtons.document.all.tags(''''''''IMG'''''''')[5].disabled=true;
ctlButtons.document.all.tags(''''''''IMG'''''''')[6].disabled=true;
ctlButtons.document.all.tags(''''''''IMG'''''''')[7].disabled=true;
ctlButtons.document.all.tags(''''''''IMG'''''''')[8].disabled=true;

frame_number=movie.CurrentFrame();
jindu();
}
//顯示層函數(shù)
function showMenu(menu){
menu.style.display=''''''''block'''''''';
}

//鼠標(biāo)點(diǎn)擊滾動(dòng)條上的位置,影片相應(yīng)播放到那個(gè)位置
function Jump(fnume){
if(movie.IsPlaying()){
Pause();
movie.GotoFrame(fnume);
Play();
}
else
{
movie.GotoFrame(fnume);
Play();
}
}

//以下兩個(gè)函數(shù)是圖片切換函數(shù)
function fnOnMouseOver(){
element.src = "images/button/posbar.gif";
}

function fnOnMouseOut(){
element.src = "images/button/posbar1.gif";
}
以上代碼,我們仔細(xì)研究后會(huì)發(fā)現(xiàn)其實(shí)很簡單,不過卻費(fèi)了我很大精力。歡迎大家繼續(xù)在此基礎(chǔ)上改進(jìn),增添新的功能。

可控制Flash Player的Javascript方法。 一覽表:
Play() ---------------------------------------- 播放動(dòng)畫
StopPlay()------------------------------------停止動(dòng)畫
IsPlaying()----------------------------------- 動(dòng)畫是否正在播放
GotoFrame(frame_number)---------------- 跳轉(zhuǎn)到某幀
TotalFrames()------------------------------- 獲取動(dòng)畫總幀數(shù)
CurrentFrame()------------------------------回傳當(dāng)前動(dòng)畫所在幀數(shù)-1
Rewind()-------------------------------------使動(dòng)畫返回第一幀
SetZoomRect(left,top,right,buttom)-------放大指定區(qū)域
Zoom(percent)------------------------------改變動(dòng)畫大小
Pan(x_position,y_position,unit)------------使動(dòng)畫在x,y方向上平移
PercentLoaded()----------------------------返回動(dòng)畫被載入的百分比
LoadMovie(level_number,path)----------- 加載動(dòng)畫
TGotoFrame(movie_clip,frame_number)- movie_clip跳轉(zhuǎn)到指定幀數(shù)
TGotoLabel(movie_clip,label_name)------ movie_clip跳轉(zhuǎn)到指定標(biāo)簽
TCurrentFrame(movie_clip)--------------- 回傳movie_clip當(dāng)前幀-1
TCurrentLabel(movie_clip)-----------------回傳movie_clip當(dāng)前標(biāo)簽
TPlay(movie_clip)---------------------------播放movie_clip
TStopPlay(movie_clip)----------------------停止movie_clip的播放
GetVariable(variable_name)-----------------獲取變量
SetVariable(variable_name,value)-----------變量賦值
TCallFrame(movie_clip,frame_number)---call指定幀上的action
TCallLabel(movie_clip,label)----------------call指定標(biāo)簽上的action
TGetProperty(movie_clip,property)--------獲取movie_clip的指定屬性
TSetProperty(movie_clip,property,number)-設(shè)置movie_clip的指定屬性
以上代碼,我們仔細(xì)研究后會(huì)發(fā)現(xiàn)其實(shí)很簡單,不過卻費(fèi)了我很大精力。歡迎大家繼續(xù)在此基礎(chǔ)上改進(jìn),增添新的功能。
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
網(wǎng)頁自動(dòng)生成二維碼
收藏一些有用的JS代碼
網(wǎng)頁圖片處理代碼全集整理
jquery中將鼠標(biāo)放到圖片上面局部放大
巧妙的幻燈片秀
網(wǎng)頁上可拖拽的圖片
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服