evet kardeş tahmin etttiğim gibi flash player modul şeklinde yapılacağını pek sanmıyorum biraz flash bilgisiyle halledebilirsn radyo diil sadece mp3 çalar bunların genelde root da bir dosyaları olu içine mp3 attığında otomatik olarak algılar ve çalar ... roota bak dosyasının içerisine mp3 at dene bakalım olucak mı ???
Kayıt: Jun 13, 2006 Mesajlar: 56 Konum: nereye :-D
Tarih: 2007-08-11, 23:11:39 Mesaj konusu: Re: biolab temam var radyosu var temanın ama nasıl çalıştıra
flash içinde şu kodlar var
Kod:
function xmlIsLoaded(success)
{
playList_xml = new XML();
playList_xml = this.firstChild;
if (success)
{
for (i = 0; i < playList_xml.childNodes.length; i++)
{
location = String(playList_xml.childNodes[i].attributes.location);
artist = String(playList_xml.childNodes[i].attributes.artist);
album = String(playList_xml.childNodes[i].attributes.album);
songname = String(playList_xml.childNodes[i].attributes.songname);
thisTrack = new mp3Track(location + ".mp3", artist, album, songname);
if (location.length > 0)
{
playlist_array.push(thisTrack);
} // end if
} // end of for
clearInterval(trackTimer);
clearInterval(fieldTimer);
if (playlist_array.length > 0)
{
playlist_array.shuffle();
playTrack();
}
else
{
clearInterval(trackTimer);
clearInterval(fieldTimer);
trackInfo = "ERROR: no tracks";
fieldTimer = setInterval(updateFields, 100);
} // end else if
}
else
{
xmlStatus = this.status;
if (xmlStatus < 0)
{
xmlStatus = -1 * xmlStatus;
} // end if
errMsg = "There was an error loading the XML:\n";
switch (xmlStatus)
{
case 0:
{
errMsg = errMsg + "No data returned.";
break;
}
case 2:
{
errMsg = errMsg + "A CDATA section was not properly terminated.";
break;
}
case 3:
{
errMsg = errMsg + "The XML declaration was not properly terminated.";
break;
}
case 4:
{
errMsg = errMsg + "The DOCTYPE declaration was not properly terminated.";
break;
}
case 5:
{
errMsg = errMsg + "A comment was not properly terminated.";
break;
}
case 6:
{
errMsg = errMsg + "An XML element was malformed.";
break;
}
case 7:
{
errMsg = errMsg + "Out of memory.";
break;
}
case 8:
{
errMsg = errMsg + "An attribute value was not properly terminated.";
break;
}
case 9:
{
errMsg = errMsg + "A start-tag was not matched with an end-tag.";
break;
}
case 10:
{
errMsg = errMsg + "An end-tag was encountered without a matching start-tag.";
break;
}
default:
{
errMsg = errMsg + "General XML load error.";
break;
}
} // End of switch
trackInfo = errMsg;
clearInterval(fieldTimer);
fieldTimer = setInterval(updateFields, 100);
} // end else if
} // End of the function
NC_xml = new XML();
NC_xml.ignoreWhite = true;
NC_xml.onLoad = xmlIsLoaded;
Array.prototype.shuffle = function ()
{
var _loc5 = this.length - 1;
var _loc3 = _loc5;
while (_loc3--)
{
var _loc2 = parseInt(Math.random() * _loc5);
var _loc4 = this[_loc3];
this[_loc3] = this[_loc2];
this[_loc2] = _loc4;
} // end while
};
setProperty("", _soundbuftime, 6);
track_sound = new Sound();
playlist_array = new Array();
trackTimer = "";
currentTrack = 0;
currentVol = 100;
trackPlaying = 0;
dT = 50;
tickerMax = 25;
currentChar = 0;
currentSpace = 0;
trailingSpace = 20;
currentStr = "";
fieldTimer = "";
trackInfo = "loading playlist";
NC_xml.load("includes/DDmp3/playlist.xml");
function updateFields()
{
if (trackPlaying)
{
trackTotal = track_sound.getBytesTotal();
trackLoaded = track_sound.getBytesLoaded();
trackHead = track_sound.position;
cleanTime = trackHead / 1000;
numMilisec = Math.round(trackHead % 1000);
if (cleanTime < 60)
{
numMinutes = 0;
numSeconds = Math.floor(cleanTime);
}
else
{
numMinutes = Math.floor(cleanTime / 60);
numSeconds = Math.floor(cleanTime % 60);
} // end else if
if (numMilisec < 10)
{
numMilisec = "00" + String(numMilisec);
}
else if (numMilisec < 100)
{
numMilisec = "0" + String(numMilisec);
}
else
{
numMilisec = String(nummiliSec);
} // end else if
numMilisec = numMilisec < 10 ? ("0" + String(numMilisec)) : (String(numMilisec));
numMinutes = numMinutes < 10 ? ("0" + String(numMinutes)) : (String(numMinutes));
numSeconds = numSeconds < 10 ? ("0" + String(numSeconds)) : (String(numSeconds));
TrackTime_txt.text = numMinutes + ":" + numSeconds;
if (trackInfo == "")
{
currentChar = 0;
currentSpace = 0;
currentStr = "";
}
else if (currentChar < trackInfo.length)
{
if (currentChar < tickerMax)
{
currentStr = currentStr + trackInfo.charAt(currentChar);
}
else
{
currentStr = currentStr.substring(1, currentStr.length) + trackInfo.charAt(currentChar);
} // end else if
++currentChar;
}
else
{
if (currentSpace == tickerMax + trailingSpace)
{
currentChar = 0;
currentSpace = 0;
currentStr = "";
} // end if
if (currentchar < tickerMax)
{
currentStr = currentStr + " ";
}
else
{
currentStr = currentStr.substring(1, currentStr.length) + " ";
} // end else if
++currentSpace;
} // end else if
}
else
{
trackInfo = "";
currentStr = "";
currentChar = 0;
currentSpace = 0;
TrackTime_txt.text = "00:00";
clearInterval(fieldTimer);
} // end else if
TrackInfo_txt.text = currentStr;
} // End of the function
function checkTrack()
{
if (trackPlaying)
{
trackTotal = track_sound.getBytesTotal();
trackLoaded = track_sound.getBytesLoaded();
trackHead = track_sound.position;
if (parseInt(trackLoaded / trackTotal) == 1)
{
trackLength = track_sound.duration;
if (trackHead >= trackLength - 1)
{
nextTrack(1);
} // end if
} // end if
}
else
{
trackTotal = 0;
trackLoaded = 0;
trackHead = 0;
} // end else if
} // End of the function
function setVol(up)
{
if (up)
{
currentVol = currentVol + 10;
if (currentVol > 100)
{
currentVol = 100;
} // end if
}
else
{
currentVol = currentVol - 10;
if (currentVol < 0)
{
currentVol = 0;
} // end if
} // end else if
track_sound.setVolume(_root.currentVol);
} // End of the function
function playTrack()
{
if (!trackPlaying)
{
track_sound = new Sound();
track_sound.loadSound(playlist_array[currentTrack].location, 1);
track_sound.setVolume(currentVol);
trackInfo = "";
trackPlaying = 1;
if (playlist_array[currentTrack].artist != "")
{
trackInfo = " Artist: " + playlist_array[currentTrack].artist;
}
else
{
trackInfo = " Artist: N/A ";
} // end else if
if (playlist_array[currentTrack].album != "")
{
trackInfo = trackInfo + (" Album: " + playlist_array[currentTrack].album);
}
else
{
trackInfo = trackInfo + " Album: N/A";
} // end else if
if (playlist_array[currentTrack].songname != "")
{
trackInfo = trackInfo + (" Title: " + playlist_array[currentTrack].songname);
}
else
{
trackInfo = trackInfo + " Title: N/A ";
} // end else if
clearInterval(fieldTimer);
fieldTimer = setInterval(updateFields, 100);
clearInterval(trackTimer);
trackTimer = setInterval(checkTrack, dT);
} // end if
} // End of the function
function nextTrack(up)
{
stopTrack();
if (up)
{
++currentTrack;
if (currentTrack >= playlist_array.length)
{
currentTrack = 0;
} // end if
}
else
{
--currentTrack;
if (currentTrack < 0)
{
currentTrack = playlist_array.length - 1;
} // end if
} // end else if
trackInfo = "";
trackPlaying = 0;
playTrack();
} // End of the function
function stopTrack()
{
track_sound.stop();
trackInfo = "";
trackPlaying = 0;
currentChar = 0;
currentSpace = 0;
trackInfo = "";
currentStr = "";
clearInterval(trackTimer);
} // End of the function
function mp3Track(location, artist, album, songname)
{
this.location = location;
this.artist = artist;
this.album = album;
this.songname = songname;
} // End of the function
flash bilgim fazla olmadığı için yardımcı olamıcam ama bi fikir yürütmene yardımcı olabilir.Ama az anladığım kadarıyla bi playlist.xml dosyasından yada .mp3 uzantılı dosya istiyor
bu örnek bi xml dosyası kullanabilirsin bi notepad dosyasinin içerisine at xml olucak şekilde ayarla ...bi de root herhangi bir dosya adı diil sitenin bulunduğu en geniş aralık diyelim yani genel bi ifade burda sık sık duyarsın ;)
dostum root u karıştırma root'u geçtik :) nuri nin attığı dosyayı düzenle olmazsa yardımcı olurum verdiğin kodlarda bazı dosyaları çağıran kodlar var bu dosyalar yoksa eğer kendin oluşturucan ..
60$ bu fiyata satılan bi tema piyasada bedavaya geziyosa eksik olabileceğini sanıyorum.Ben denedim gönderdiğim dosyada olmadı.Bulursam bi yolunu yazarım hayırlı geceler
Bu forumda yeni başlıklar açamazsınız Bu forumdaki başlıklara cevap veremezsiniz Bu forumdaki mesajlarınızı değiştiremezsiniz Bu forumdaki mesajlarınızı silemezsiniz Bu forumdaki anketlerde oy kullanamazsınız