例如加载flv,swf的时候 可以知道是什么格式吗?
[code]
var url:String ="http://bbs.blueidea.com/images/common/back.gif";
var tempArr:Array = url.split(".")
trace(tempArr[tempArr.length-1]);
[/code]
contentType可以显示加载的类型,对应类型:
swf-"application/x-shockwave-flash"
jpg-"image/jpeg"
gif-"image/gif"
png-"image/png"
[code]
var loader:Loader=new Loader();
loader.load(new URLRequest("http://bbs.blueidea.com/images/default/logo.gif"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, LoadEnd);
function LoadEnd(evt:Event):void {
trace(evt.target.contentType);
}
[/code]