Robiņo
%Europe/Berlin %577 %2005, 14:52
hallo.
ik ben hier nieuw en nog een noob als het om flash gaat, maar ik wel het gaan leren.
PHP kan ik wel en ik heb dit script gemaakt:
<?php
error_reporting(E_ALL);
class musicplayer
{
var $aantalmp3s;
function mp3check($map)
{
chmod($map, 0777);
$handle = opendir($map);
if(file_exists($map."/playlist.m3u"))
{
unlink($map."/playlist.m3u");
}
$playlist = fopen($map."/playlist.m3u", "w");
fputs($playlist ,"#EXTM3U\n");
while(false != ($read = readdir($handle)))
{
if(is_file($map."/".$read))
{
$ext = explode(".", $map."/".$read);
$count = count($ext);
$count = $count - 1;
if($ext[$count] == "mp3")
{
fputs($playlist, $read."\n\n");
$file['mp3'][] = $read;
$this->aantalmp3s++;
}
}
}
closedir($handle);
return $file;
}
function mp3count()
{
return $this->aantalmp3s;
}
}
$musicplayer = new musicplayer;
?>
<html>
<head>
<title>PHP-MP3 Player</title>
</head>
<body bgcolor="#DDDDDD">
<center>
<table border="1" width="380">
<tr>
<td colspan="2"><p align="center"><b>Tracklist</b></p></td>
</tr>
<?php
$locatie = "muziek"; //zonder '/'
$mp3s = $musicplayer->mp3check($locatie);
$i=1;
foreach($mp3s['mp3'] as $mp3)
{
$mp3 = str_replace(".mp3", "", $mp3);
echo "<tr>";
echo "<td width=\"15\">".$i."</td>";
echo "<td width=\"365\">".$mp3."</td>";
echo "</tr>";
$i++;
}
?>
</table>
</center>
</body>
</html>
nu is mijn vraag... hoe zet ik dit om naar AS, of hoe laat ik de variabelen in?
Grtn Robin
ik ben hier nieuw en nog een noob als het om flash gaat, maar ik wel het gaan leren.
PHP kan ik wel en ik heb dit script gemaakt:
<?php
error_reporting(E_ALL);
class musicplayer
{
var $aantalmp3s;
function mp3check($map)
{
chmod($map, 0777);
$handle = opendir($map);
if(file_exists($map."/playlist.m3u"))
{
unlink($map."/playlist.m3u");
}
$playlist = fopen($map."/playlist.m3u", "w");
fputs($playlist ,"#EXTM3U\n");
while(false != ($read = readdir($handle)))
{
if(is_file($map."/".$read))
{
$ext = explode(".", $map."/".$read);
$count = count($ext);
$count = $count - 1;
if($ext[$count] == "mp3")
{
fputs($playlist, $read."\n\n");
$file['mp3'][] = $read;
$this->aantalmp3s++;
}
}
}
closedir($handle);
return $file;
}
function mp3count()
{
return $this->aantalmp3s;
}
}
$musicplayer = new musicplayer;
?>
<html>
<head>
<title>PHP-MP3 Player</title>
</head>
<body bgcolor="#DDDDDD">
<center>
<table border="1" width="380">
<tr>
<td colspan="2"><p align="center"><b>Tracklist</b></p></td>
</tr>
<?php
$locatie = "muziek"; //zonder '/'
$mp3s = $musicplayer->mp3check($locatie);
$i=1;
foreach($mp3s['mp3'] as $mp3)
{
$mp3 = str_replace(".mp3", "", $mp3);
echo "<tr>";
echo "<td width=\"15\">".$i."</td>";
echo "<td width=\"365\">".$mp3."</td>";
echo "</tr>";
$i++;
}
?>
</table>
</center>
</body>
</html>
nu is mijn vraag... hoe zet ik dit om naar AS, of hoe laat ik de variabelen in?
Grtn Robin