當前位置:首頁 » 操作系統 » flash音樂播放器源碼

flash音樂播放器源碼

發布時間: 2022-03-30 19:26:51

A. flash做音樂播放器源代碼

去flash8.net網站上找吧

B. 音樂播放器flash 代碼 ,請教高手幫忙解釋一下其中帶//一段的代碼意思

?: 條件運算符
expression1 ? expression2 : expression3

指示 Flash 計算 expression1,如果 expression1 的值為 true,則返回值 expression2;否則返回值 expression3。

可用性:ActionScript 1.0、Flash Player 4

C. flash 音樂播放代碼

早幾年做過一個控制聲音的AS,可以讓音樂播放、暫停、再播放,而且再播放的地方是從音樂停止的地方開始播放,與你共享下:1.動畫的_root第1幀: mysound = new Sound(); //聲明一個聲音變數; mysound.attachSound("music1"); //將需要載入的音樂綁定在變數上,「music1」為庫文件中需載入聲音的linkage名; mysound.start(); //綁定好的音樂開始播放,start()中,可以加入開始播放時間,單位為秒; 2.動畫中需要暫停的幀: _root.stop(); //主時間軸停止播放動畫; mysound.stop(); //載入的聲音變數停止播放; soundpo = mysound.position / 1000; //聲明一個新變數,並賦值把聲音停止播放的時間,由於position屬性的單位為毫秒,故整除以1000; 3.繼續播放按鈕: on (press) //如有需要幫助的地方,再找我。

D. FLASH音樂播放器源文件

MP3播放器?用FLASH,FLEX都可以啊

★火山flash音樂播放器三部曲完成(附源文件和歌詞同步教程):
http://bbs.blueidea.com/thread-2682812-1-2.html

E. 下面的博客內嵌flash音樂播放器代碼怎麼改

這莫多,坑我

F. 求flash的mp3播放器代碼

在as3 cookbook 裡面已經有很多關於mp3玩法。功能 是大同小異。
基本上功能有 播放,暫停,停止,拖放進度,靜音,音量控制。主要的涉及到這些。

下面涉及到一些基本方法說明:
position 是位置記錄。
播放音樂
channel=sound.play(position); 播放
停止音樂
channel.stop();停止
暫停的時候,先記錄位置,再停止
position=channel.position;//記錄當時的播放位置
channel.stop();
恢復播放的時候,利用這個位置Postion進行播放。
channel=sound.play(position); 播放
5、進度條交互
進度條的拖放交互,使用的滑鼠按下,滑鼠移動,滑鼠松開的組合方式交互。
當滑鼠按下的時候,可以讓進度條寬度改變,產生進度改變。
progressBar.controlBar.width=progressBar.mouseX;
在滑鼠移動的時候,使用滑鼠坐標改變進度條的寬度。這樣子進度條就像被拖放一樣,實際上是改變了控制條的寬度。
progressBar.controlBar.width=progressBar.mouseX;
滑鼠松開的時候,刪除移動的監聽事件
stage.removeEventListener(MouseEvent.MOUSE_UP,onMouseUPHandler);
完整代碼:
一些說明:
當中一些跳轉的幀,如
volumeBtn.gotoAndStop("stop"); 需要在元件裡面設置幀標簽。(volumeBtn 為音量控制按鈕,用於靜音設置)
volumeBar :音量控制條
progressBar:進度顯示條
stopBtn:停止按鈕
playBtn:播放按鈕

-----------------------------------------------------------------------------------
package
{
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.events.*;
import flash.net.*;
import flash.media.*;
import flash.geom.*;
import flash.display.SimpleButton;
public class Main extends Sprite
{
private var position:Number=0;//播放位置
private var channel:SoundChannel;
private var sound:Sound;
private var songUrl:String="1.mp3";//mp3的路徑
private var isPlay:Boolean=false;//是否播放
public function Main()
{
init();
}
private function init():void
{
//載入音樂
sound=new Sound();
sound.addEventListener(IOErrorEvent.IO_ERROR,onErrorHandler);
sound.addEventListener(Event.COMPLETE,onLoadSoundComplete);
sound.load(new URLRequest(songUrl));

playBtn.stop();
volumeBtn.stop();
playBtn.buttonMode=true;
stopBtn.buttonMode=true;
progressBar.controlBar.mouseEnabled=false;
volumeBar.controlBar.mouseEnabled=false;
progressBar.buttonMode=true;
volumeBtn.buttonMode=true;
volumeBar.buttonMode=true;

volumeBar.controlBar.width=volumeBar.width;
//trace(volumeBar.width)
//開始按鈕,停止按鈕,進度條監聽滑鼠事件
playBtn.addEventListener(MouseEvent.CLICK,onPlaySoundHandler);
stopBtn.addEventListener(MouseEvent.CLICK,onStopSoundHandler);
progressBar.addEventListener(MouseEvent.MOUSE_DOWN,onStartDragBarHandler);
volumeBtn.addEventListener(MouseEvent.CLICK,onMuteSoundHandler);
volumeBar.addEventListener(MouseEvent.MOUSE_DOWN,onStartDragVolomeBarHandler);
}
private function onErrorHandler(event:Event):void
{
trace("發生錯誤");
}
private function onLoadSoundComplete(event:Event):void
{
sound.removeEventListener(Event.COMPLETE,onLoadSoundComplete);
channel=sound.play(position);//開始播放
playBtn.gotoAndStop("pause");
isPlay=true;
addEventListener(Event.ENTER_FRAME,onProgressHandler);
}
private function onProgressHandler(event:Event):void
{
if (channel==null)return;
if (isPlay)
{
progressBar.controlBar.width=channel.position/sound.length*progressBar.width;//讓進度條產生寬度變化
}

if (progressBar.controlBar.width<=progressBar.width && progressBar.controlBar.width>=progressBar.width-2)
{
stopSound();
}
}
//播放和暫停處理
private function onPlaySoundHandler(event:MouseEvent):void
{
if (playBtn.currentLabel=="start")
{
if (isPlay==false)
{
isPlay=true;
playBtn.gotoAndStop("pause");
playSound();
}
}
else
{
if (isPlay)
{
isPlay=false;
playBtn.gotoAndStop("start");
pauseSound();
}
}
}
private function onStopSoundHandler(event:MouseEvent):void
{
stopSound();
}
private function onStartDragBarHandler(event:MouseEvent):void
{
channel.stop();
playBtn.gotoAndStop("pause");
progressBar.controlBar.width=progressBar.mouseX;
event.updateAfterEvent();
position=progressBar.controlBar.width/progressBar.width*sound.length;

channel=sound.play(position);
progressBar.addEventListener(MouseEvent.MOUSE_MOVE,onMouseMoveHandler);
stage.addEventListener(MouseEvent.MOUSE_UP,onMouseUPHandler);
}
private function onMouseMoveHandler(event:MouseEvent):void
{
channel.stop();
progressBar.controlBar.width=progressBar.mouseX;

position=progressBar.controlBar.width/progressBar.width*sound.length;
channel=sound.play(position);
event.updateAfterEvent();
}
private function onMouseUPHandler(event:MouseEvent):void
{
if (progressBar.hasEventListener(MouseEvent.MOUSE_MOVE))
{
progressBar.removeEventListener(MouseEvent.MOUSE_MOVE,onMouseMoveHandler);
}

if (volumeBar.hasEventListener(MouseEvent.MOUSE_MOVE))
{
volumeBar.removeEventListener(MouseEvent.MOUSE_MOVE,onChangeVolumeHandler);
}
stage.removeEventListener(MouseEvent.MOUSE_UP,onMouseUPHandler);
}
//靜音處理
private function onMuteSoundHandler(event:MouseEvent):void
{
if (channel==null)return;

if (volumeBtn.currentLabel=="start")
{
volumeBtn.gotoAndStop("stop");
channel.soundTransform=new SoundTransform(0);
}
else
{
volumeBtn.gotoAndStop("start");
channel.soundTransform=new SoundTransform(1);
}
}
//拖動聲音控制
private function onStartDragVolomeBarHandler(event:MouseEvent):void
{
volumeBar.controlBar.width=volumeBar.mouseX;
var volume:Number=volumeBar.controlBar.width/volumeBar.width;
channel.soundTransform=new SoundTransform(volume);
event.updateAfterEvent();
volumeBar.addEventListener(MouseEvent.MOUSE_MOVE,onChangeVolumeHandler);
stage.addEventListener(MouseEvent.MOUSE_UP,onMouseUPHandler);
}

//改音樂
private function onChangeVolumeHandler(event:MouseEvent):void
{
volumeBar.controlBar.width=volumeBar.mouseX;
trace(progressBar.controlBar.width);
var volume:Number=volumeBar.controlBar.width/volumeBar.width;
channel.soundTransform=new SoundTransform(volume);
event.updateAfterEvent();
stage.addEventListener(MouseEvent.MOUSE_UP,onMouseUPHandler);
}
//停止播放音樂
private function stopSound():void
{
if (channel==null)return;
channel.stop();
playBtn.gotoAndStop("start");
position=0;
isPlay=false;
progressBar.controlBar.width=1;

}
//播放音樂
private function playSound():void
{
if (channel==null)return;
channel=sound.play(position);
}
//暫停音樂
private function pauseSound():void
{
if (channel==null)return;
position=channel.position;//記錄當時的播放位置
channel.stop();
}
}
}

G. 求flash AS3音樂播放器代碼

附件是我以前寫的一個播放器,不過沒有選擇文件的選項,是默認載入一個xml文件里的文件,

解壓後,playList/playlist.xml是音樂列表,xml格式如下

<root>
<songname="歌曲名1"artist="歌手名"path="歌曲路徑"lrc="lrc歌詞路徑"></song>
<songname="歌曲名2"artist="歌手名"path="歌曲路徑"lrc="lrc歌詞路徑"></song>
</root>

其中name/artist/path是必須的,lrc可以省略(省略時,會自動搜索歌曲同目錄下同文件名的lrc文件,如果搜索到就會載入,如果沒有找到,就會一片空白)

H. 這是一個Flash的小型音樂播放器里的動作代碼但是不知道怎麼用 望高人指點一下

snd.loadSound("start.mp3", false);//載入文件
你注意一下這個代碼都有注釋(//後面的),你是程序員嗎?如果是應該能看懂。
具體要看你怎麼用,用在什麼地方,還有就是這段代碼的運行環境我也不知道。。。。

I. 求flash音樂播放器代碼

鑲嵌在網頁中的各種播放器代碼 zt

1.avi格式

<object id="video" width="400" height="200" border="0" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA">
<param name="ShowDisplay" value="0">
<param name="ShowControls" value="1">
<param name="AutoStart" value="1">
<param name="AutoRewind" value="0">
<param name="PlayCount" value="0">
<param name="Appearance value="0 value=""">
<param name="BorderStyle value="0 value=""">
<param name="MovieWindowHeight" value="240">
<param name="MovieWindowWidth" value="320">
<param name="FileName" value="文件路徑">
<embed width="400" height="200" border="0" showdisplay="0" showcontrols="1" autostart="1" autorewind="0" playcount="0" moviewindowheight="240" moviewindowwidth="320" filename="文件路徑" src="Mbar.avi">
</embed>
</object>

2.mpg格式

<object classid="clsid:05589FA1-C356-11CE-BF01-00AA0055595A" id="ActiveMovie1" width="239" height="250">
<param name="Appearance" value="0">
<param name="AutoStart" value="-1">
<param name="AllowChangeDisplayMode" value="-1">
<param name="AllowHideDisplay" value="0">
<param name="AllowHideControls" value="-1">
<param name="AutoRewind" value="-1">
<param name="Balance" value="0">
<param name="CurrentPosition" value="0">
<param name="DisplayBackColor" value="0">
<param name="DisplayForeColor" value="16777215">
<param name="DisplayMode" value="0">
<param name="Enabled" value="-1">
<param name="EnableContextMenu" value="-1">
<param name="EnablePositionControls" value="-1">
<param name="EnableSelectionControls" value="0">
<param name="EnableTracker" value="-1">
<param name="Filename" value="../../../mpeg/halali.mpg" valuetype="ref">
<param name="FullScreenMode" value="0">
<param name="MovieWindowSize" value="0">
<param name="PlayCount" value="1">
<param name="Rate" value="1">
<param name="SelectionStart" value="-1">
<param name="SelectionEnd" value="-1">
<param name="ShowControls" value="-1">
<param name="ShowDisplay" value="-1">
<param name="ShowPositionControls" value="0">
<param name="ShowTracker" value="-1">
<param name="Volume" value="-480">
</object>

3.smi格式

<OBJECT id=RVOCX classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA width=240
height=180>
<param name="_ExtentX" value="6350">
<param name="_ExtentY" value="4763">
<param name="AUTOSTART" value="-1">
<param name="SHUFFLE" value="0">
<param name="PREFETCH" value="0">
<param name="NOLABELS" value="-1">
<param name="SRC" value="rm.rm">
<param name="CONTROLS" value="ImageWindow">
<param name="CONSOLE" value="console1">
<param name="LOOP" value="0">
<param name="NUMLOOP" value="0">
<param name="CENTER" value="0">
<param name="MAINTAINASPECT" value="0">
<param name="BACKGROUNDCOLOR" value="#000000"><embed src="real.smi" type="audio/x-pn-realaudio-plugin" console="Console1" controls="ImageWindow" height="180" width="240" autostart="true"></OBJECT>

4.rm格式

<OBJECT ID=video1 CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" HEIGHT=288 WIDTH=352>

<param name="_ExtentX" value="9313">
<param name="_ExtentY" value="7620">
<param name="AUTOSTART" value="0">
<param name="SHUFFLE" value="0">
<param name="PREFETCH" value="0">
<param name="NOLABELS" value="0">
<param name="SRC" value="rtsp://203.207.131.35/vod/dawan-a.rm";;;;>
<param name="CONTROLS" value="ImageWindow">
<param name="CONSOLE" value="Clip1">
<param name="LOOP" value="0">
<param name="NUMLOOP" value="0">
<param name="CENTER" value="0">
<param name="MAINTAINASPECT" value="0">
<param name="BACKGROUNDCOLOR" value="#000000"><embed SRC type="audio/x-pn-realaudio-plugin" CONSOLE="Clip1" CONTROLS="ImageWindow" HEIGHT="288" WIDTH="352" AUTOSTART="false">

</OBJECT>

華哥 2005-7-5 14:37

5.wmv格式

<object id="NSPlay" width=200 height=180 classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject" align="right" hspace="5">
<!-- ASX File Name -->
<param name="AutoRewind" value=1>
<param name="FileName" value="xxxxxx.wmv">
<!-- Display Controls -->

<param name="ShowControls" value="1">
<!-- Display Position Controls -->

<param name="ShowPositionControls" value="0">
<!-- Display Audio Controls -->

<param name="ShowAudioControls" value="1">
<!-- Display Tracker Controls -->

<param name="ShowTracker" value="0">
<!-- Show Display -->

<param name="ShowDisplay" value="0">
<!-- Display Status Bar -->

<param name="ShowStatusBar" value="0">
<!-- Diplay Go To Bar -->

<param name="ShowGotoBar" value="0">
<!-- Display Controls -->

<param name="ShowCaptioning" value="0">
<!-- Player Autostart -->

<param name="AutoStart" value=1>
<!-- Animation at Start -->

<param name="Volume" value="-2500">
<param name="AnimationAtStart" value="0">
<!-- Transparent at Start -->

<param name="TransparentAtStart" value="0">
<!-- Do not allow a change in display size -->

<param name="AllowChangeDisplaySize" value="0">
<!-- Do not allow scanning -->

<param name="AllowScan" value="0">
<!-- Do not show contect menu on right mouse click -->

<param name="EnableContextMenu" value="0">
<!-- Do not allow playback toggling on mouse click -->
<param name="ClickToPlay" value="0">
</object>

J. qq空間flash音樂播放器的原理或源代碼

首先我們打開搜索工具「一搜」,
把其上的「網頁」改成「MP3」,播放模式改成「WMA」,然後輸入自己想要的歌曲即可,如「一直很安靜」。點擊「歌曲搜索」又出來下面的畫面,最好先「試聽」一下,防止此歌有漏洞,然後點擊「歌曲名稱」如「一直很安靜」,看見「來源網址」了沒?復制一下就OK了,下面的你自己就會操作了吧,不用我教了啊,呵呵,就是這么簡單!

熱點內容
神演算法 發布:2024-03-29 22:38:54 瀏覽:105
教學視頻文字腳本 發布:2024-03-29 22:29:49 瀏覽:137
java心跳檢測 發布:2024-03-29 22:28:53 瀏覽:981
玩戰地5配置不行怎麼辦 發布:2024-03-29 22:10:28 瀏覽:981
javaice 發布:2024-03-29 21:56:37 瀏覽:355
編譯圖書 發布:2024-03-29 21:56:36 瀏覽:332
linux全選vi 發布:2024-03-29 21:55:11 瀏覽:774
艾譜保險箱初始密碼一般是什麼 發布:2024-03-29 21:48:11 瀏覽:825
商家粉腳本 發布:2024-03-29 21:34:57 瀏覽:151
我的世界ec伺服器怎麼獲得 發布:2024-03-29 21:21:44 瀏覽:709