Duane, thanks for the hint - i already got the trace statements. Testing is ok with an ssh/sftp connection (although i dont know what i have to kill to stop the controlpanel from respawning).
Nevertheless it isnt working:
The path in your snippet is "/mnt/usb", but in the controlpanel it is "//mnt/usb/" and only with this path i get stream 1 opened.
I copied now the essential parts of the controlpanel, to try exactly the same code in my environment (Flash CS3), but it isnt working either...
This is the output:
2008-03-31 00:36:07 TRACE: find
2008-03-31 00:36:07 TRACE: //mnt/usb/
2008-03-31 00:36:07 TRACE: return xml
2008-03-31 00:36:07 FileStreamRequest::Open(): Opening file '//mnt/usb/' on stream 1
2008-03-31 00:36:07 TRACE: undefined
2008-03-31 00:36:07 TRACE: find
2008-03-31 00:36:07 TRACE: MP3FilesPanelScanner.processMusic():
_global.FileFinder = function (rootDirectory)
{
this._protocol = "file://";
this._directories = [rootDirectory];
this._files = [];
this._dirXML = new XML();
this._dirXML.ignoreWhite = true;
this._dirXML.__target = this;
this._dirXML.onLoad = function (success)
{
if (success)
{
this.__target.processDirectory(this.firstChildOfType("directory"));
}
this._dirXML = undefined;
}
;
}
;
FileFinder.prototype.processDirectory = function (dir)
{
trace(dir);
var base = dir.attributes.path;
var fileItems = dir.childrenOfTypeAnd("file", this.matchFunction);
for (var i in fileItems)
{
this._files.push(base + "/" + fileItems[i].attributes.name);
}
var dirs = dir.childrenOfTypeAnd("directory", function (d)
{
return d.attributes.name.charAt(0) != ".";
}
);
for (var i in dirs)
{
this._directories.push(base + "/" + dirs[i].attributes.name);
}
if (this.find())
{
return;
}
this.completionFunction.call(this.target, this._files);
}
;
FileFinder.prototype.find = function ()
{
trace("find");
if (this._directories.length > 0)
{
var dir = this._directories.pop();
this._dirXML.load(this._protocol + dir);
trace(dir);
trace("return xml");
return true;
}
return false;
}
;
_global.MP3FilesPanelScanner = function ()
{
finder = new FileFinder("//mnt/usb/");
finder.matchFunction = this.isMusicFile;
finder.target = this;
finder.completionFunction = this.processMusic;
finder.find();
}
;
MP3FilesPanelScanner.prototype.isMusicFile = function (f)
{
trace("f");
var n = f.attributes.name;
var ext3 = n.slice(-4);
var ext4 = n.slice(-5);
return n.charAt(0) != "." && ext3 == ".mp3" || ext3 == ".ogg" || ext4 == ".flac" || ext3 == ".m4a" || ext3 == ".wav";
}
;
MP3FilesPanelScanner.prototype.processMusic = function (files)
{
trace("MP3FilesPanelScanner.processMusic(): " + files);
}
;
bLeft.onRelease = function () {
scanner = new MP3FilesPanelScanner();
};