private var _loaderformat:String;
private var _loadURL:String;
private var _loadertype:String;
//////////////////////////////
//URL Loader builder.
//Text/Binary & SWF/Image objects.
//////////////////////////////
public function urlLoaderBuilder (_loadURL, _loaderformat = 'text', _loadertype = 'urlloader') {
var req:URLRequest = new URLRequest(_loadURL);
switch(_loadertype) {
case 'urlloader':
var urlloader:URLLoader = new URLLoader();
urlloader.load (req);
switch(_loaderformat) {
case 'text':
urlloader.dataFormat = URLLoaderDataFormat.TEXT;
break;
case 'variables':
urlloader.dataFormat = URLLoaderDataFormat.VARIABLES;
break;
case 'binary':
urlloader.dataFormat = URLLoaderDataFormat.BINARY;
break;
}
return urlloader;
break;
case 'loader':
var loader:Loader = new Loader();
loader.load (req);
return loader;
break;
}
}
//////////////////////////////