php執行javaScript的語法
echo "<script language=\"JavaScript\">";
echo "window.alert(\"你未登入\");"; //警告對話方塊
echo "location.href(\"./\");"; //到首頁
echo "</script>";
php執行javaScript的語法
echo "<script language=\"JavaScript\">";
echo "window.alert(\"你未登入\");"; //警告對話方塊
echo "location.href(\"./\");"; //到首頁
echo "</script>";
動作:
import flash.events.Event;
import fl.events.SliderEvent
var sound:Sound=new Sound(new URLRequest("1.mp3")); //載入1.mp3
var soundCtl:SoundChannel=new SoundChannel(); //宣告SoundChannel
var transformSound:SoundTransform=new SoundTransform(); //宣告SoundTransform
transformSound.volume=1; //預設音量:1最大聲,0~1
soundCtl.soundTransform=transformSound; //設定SoundChannel的音量
var setre:Number=0; //播放的位置
var soundVolume:Number=10; //音量改成0~10
sound.addEventListener(Event.COMPLETE,$complete); //音樂載入完成
function $complete($e:Event):void{ //音樂載入完成的執行函數
soundCtl=sound.play(); //播放(位置=0,重覆次數:無限次)
soundCtl.addEventListener(Event.SOUND_COMPLETE,$soundComplete); //播放完畢的監聽事件
stop_btn.addEventListener(MouseEvent.CLICK,$stop); //停止鍵的監聽
play_btn.addEventListener(MouseEvent.CLICK,$play); //播放鍵的監聽
pause_btn.addEventListener(MouseEvent.CLICK,$pause);//暫停鍵的監聽
pre_btn.addEventListener(MouseEvent.CLICK,$pre); //上一首鍵的監聽
next_btn.addEventListener(MouseEvent.CLICK,$next); //下一首鍵的監聽
vol_btn.up_btn.addEventListener(MouseEvent.CLICK,$up); //音量大聲鍵的監聽
vol_btn.down_btn.addEventListener(MouseEvent.CLICK,$down);//音量小聲鍵的監聽
}
function $soundComplete($e:Event){ //播放完畢的執行函數
if(cont<5){ //共有5首mp3
cont+=1; //跳下一首
}else{
cont=1; //跳第1首
}
soundCtl.stop(); //先停止上一首mp3
sound=new Sound(new URLRequest(cont + ".mp3")); //載入下一首mp3
soundCtl=sound.play(); //播放
soundCtl.addEventListener(Event.SOUND_COMPLETE,$soundComplete); //播放完畢的監聽事件
}
function $stop($e:MouseEvent):void{ //停止的執行函數
soundCtl.stop(); //音樂停止
setre=0; //音樂位置:0,所以按「播放」時,會從頭播放
}
import flash.events.Event;
import fl.events.SliderEvent
var sound:Sound=new Sound(new URLRequest("1.mp3")); //載入1.mp3
var soundCtl:SoundChannel=new SoundChannel(); //宣告SoundChannel
sound.addEventListener(Event.COMPLETE,$complete); //音樂載入完成
function $complete($e:Event):void{ //音樂載入完成的執行函數
soundCtl=sound.play(); //播放(位置=0,重覆次數:無限次)
soundCtl.addEventListener(Event.SOUND_COMPLETE,$soundComplete); //播放完畢的監聽事件
stop_btn.addEventListener(MouseEvent.CLICK,$stop); //停止鍵的監聽
play_btn.addEventListener(MouseEvent.CLICK,$play); //播放鍵的監聽
pause_btn.addEventListener(MouseEvent.CLICK,$pause);//暫停鍵的監聽
}
function $soundComplete($e:Event){ //播放完畢的執行函數
if(cont<5){ //共有5首mp3
cont+=1; //跳下一首
}else{
cont=1; //跳第1首
}
soundCtl.stop(); //先停止上一首mp3
sound=new Sound(new URLRequest(cont + ".mp3")); //載入下一首mp3
soundCtl=sound.play(); //播放
soundCtl.addEventListener(Event.SOUND_COMPLETE,$soundComplete); //播放完畢的監聽事件
}
function $stop($e:MouseEvent):void{ //停止的執行函數
soundCtl.stop(); //音樂停止
setre=0; //音樂位置:0,所以按「播放」時,會從頭播放
}
function $play($e:MouseEvent):void{ //播放的執行函數
soundCtl=sound.play(setre,0);
}
function $pause($e:MouseEvent):void{ //暫停的執行函數
setre=soundCtl.position; //紀錄音樂的位置
soundCtl.stop(); //音樂停止
}
動作:
import flash.events.Event;
import fl.events.SliderEvent
var sound:Sound=new Sound(new URLRequest("1.mp3")); //載入1.mp3
var soundCtl:SoundChannel=new SoundChannel(); //宣告SoundChannel
sound.addEventListener(Event.COMPLETE,$complete); //音樂載入完成
function $complete($e:Event):void{ //音樂載入完成的執行函數
soundCtl=sound.play(); //播放(位置=0,重覆次數:無限次)
}