Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 07-06-2004, 18:00   #1 (permalink)
...
 
Registriert seit: Jun 2004
Beiträge: 115
mp3 aus verzeichniss + id3?

so hab mal eine fragen, wie bekomme ich aus einem verzeichniss mp3 ausgelesen, die dann in ein objekt reingeschrieben werden...und zusätzlich soll aus allen mp3 der id3 tag gelesen werden....hab das versucht so zu lösen, aber es funzt nit:

meine PHP Datei:

PHP-Code:
<?php
function getFileType($file){
 
$len =  strlen($file);
 return 
substr($file,-3);
}

function 
getFiles($dirname,$name,$pathname){
    
$dir = @opendir($dirname);
    
$files "";
    
$filetype "mp3";
    while(
$file readdir($dir)){    
        
$temp getFileType($file);        
        
//echo $temp;
        
if ($temp == $filetype)
        {        
            if (
$file != "." && $file != "..") {
                if(
is_dir("$dirname/$file")){
                    
getFiles("$dirname/$file",$file,"$pathname$file/");
                } else {
                    
$files .= "<list dir='$dirname/' file='$file'/>";
    }    }    }    }
    echo(
$files);
}

header("Content-type: text/xml");
echo(
"<?xml version='1.0'?>");
echo(
"<songlist>");
getFiles(".","MMK","/mp3/");
echo(
"</songlist>");
?>
FLASH:
PHP-Code:
_global.SITE "http://localhost/p4/";
_global.gbfile "read.php";

player_xml = new Object();
player_xml.entries = new Object();
player_xml.size_xml 0;
player_xml.data_xml = new XML();
player_xml.data_xml.ignoreWhite true;
//__________________________________________________
player_xml.makeArray = function(_xml_array) {
    
//
    
this._xml _xml;
    var 
theNode _xml.childNodes;
    
len theNode.length;
    
player_xml.entries.data_array = new Array();
    for (var 
0i<leni++) {
        
temp = new Object();
        
temp.file theNode[i].attributes.file;
        
temp.dir theNode[i].attributes.dir;
        
temp_sound = new Sound();
        
//temp_sound.loadSound(SITE+temp.dir+temp.file);
        //trace(temp_sound.id3);
        //trace();
        
player_xml.entries.data_array.push(temp);
        
delete (temp);
    }
    
temp_sound = new Sound();
    
dir player_xml.entries.data_array[0].dir;
    
file player_xml.entries.data_array[0].file;
    
//file = (SITE+temp1+player_xml.entries.data_array[0].file);
    
loc = (SITE+dir+file);
    
temp_sound.loadSound(locfalse);
    
trace(temp_sound.id3.artist);
    
};
//__________________________________________________
player_xml.data_xml.onLoad = function(success) {
    
trace("huhu");
    if (
success) {
        
player_xml.makeArray(this.firstChild);
    } else {
        
trace("Fehler beim Laden der XML!");
    }
};
//__________________________________________________ 
wär echt super, wenn mir auch dabei einer helfen würd...das ganze so dann nacher so aussehen:


data.array[0].file = "09 Starsplash - Friends.mp3";
data.array[0].dir "./mp3/";
data.array[0].year "2003";
data.array[0].comment "Hau mich tot!";
data.array[0].title = "Friends"
data.array[0].album = "Starsplash - Friends"
data.array[0].artist = "Starsplash";

Geändert von Tobi81 (07-06-2004 um 18:04 Uhr)
Tobi81 ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 01:01 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele