[Playlist] XSPF for haXe

tong sdk at disktree.net
Thu Apr 17 12:12:20 UTC 2008


On Thu, 2008-04-17 at 13:33 +0200, Bjorn Wijers wrote:
> Great!
> 
> I've just started using your lib, but I have some issues understanding
> how to use it. Specifically how to load an external playlist?


this depends on your haxe-target ( flash, js, neko ).
for example:

--------------flash:

var src : Xml;
var http = new haxe.Http( URLTOXSPFFILE );
http.onData = function(d) {
        src = Xml.parse(d);
        trace(src);
}
http.request(false);


-------------neko:

var src : Xml;
var file = neko.io.File.getContent( URLTOXSPFFILE );
src = Xml.parse( file );
trace( src );


--------------
you can also use the platform specific api to load files:
for flash9:

var loader = new URLLoader();
loader.addEventListener( Event.COMPLETE, function(e) {
        trace(e.target.data);
});
loader.load( new URLRequest(URLTOXSPFFILE) );


-------------
after loading/parsing xml:
var xspf = format.XSPF.parse( src );
...


greets.tong
-- 
[)   |   5   |<   †   |2   3   3




More information about the Playlist mailing list