>>Exactly.
>>You will have to code in haXe to do the following :
>>
>>- create a SWHX window
>>- load your SWF into it
>>- capture the getURL and do the appropriate codelogic (you need to
>>return the file content that will be streamed back to the flash player).
>>
>>Nicolas
>
>
> Cool - sounds really powerful... I'm sure it will all become clear once
> Screenweaver HX is out but I have one more question...
>
> > - capture the getURL and do the appropriate codelogic
>
> I'm using MovieClip.loadMovie (called from a custom loader queue) - will
> it still work with this.
Yes
All files access got through the onGetURL call
> > (you need to return the file content that will be streamed back to
> > the flash player).
>
> So there is functionality in haXe to see if there is a cached file on
> disk and if so return it (as binary data? as a reference?) otherwise
> grab the file from a remote server, save it to disk and then return it?
Exactly.
You return it as a string, since haXe/Neko strings can contain binary
data. For instance here's the default OnGetURL Handler that you can
redefine with your own :
public function onGetURL( url : String, postData : String ) {
try {
if( url.substr(0,7) == "http://" ) {
var h = new haxe.Http(url);
var data;
h.onData = function(d) { data = d; }
h.onError = function(e) { throw e; }
if( postData != null ) {
untyped h.postData = postData;
h.request(true);
} else
h.request(false);
return data;
}
if( postData != null )
throw "Cannot post without http://";
return neko.File.getContent(url);
} catch( e : Dynamic ) {
return null;
}
}
Nicolas
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org