1 Haziran 2013 Cumartesi

Adobe Flash ActionScript 3.0 Kodları ile Ses Denetimi




var pausePoint:Number=0.00;
//pauseye bastığımda kaçıncı milisaniyede kaldığımı tut



var isPlaying:Boolean;
var soundChannel:SoundChannel=new SoundChannel();
var sound:Sound = new Sound(new URLRequest("muzik.mp3"));

stop_btn.addEventListener(MouseEvent.CLICK,stp);
play_btn.addEventListener(MouseEvent.CLICK,playpause);
/*
destekleriniz için
http://flashandactionscript3.blogspot.com/ sitesini ziyeret ediniz.
*/
soundChannel=sound.play();
isPlaying=true;

function playpause (evt:MouseEvent)
{
if (isPlaying)
{
pausePoint=soundChannel.position;
soundChannel.stop();
isPlaying=false;
}
else if (!isPlaying)
{
soundChannel=sound.play(pausePoint);
isPlaying=true;
}
}

function stp (evt:MouseEvent)
{
if (isPlaying)
{
soundChannel.stop();
isPlaying=false;
}
pausePoint=0.00;
}



Hiç yorum yok:

Yorum Gönder