Syntax Error in ActionScript function
it seems there is an error in the code below, but where?
function cloneLoader(source:Loader):Loader
{
var clone:Loader = new Loader();
clone.loadBytes(source.contentLoaderInfo.bytes);
return clone;
};
clone.loadBytes is an asynchronous call. So you probably can't use the returned object right away.
Maybe try return Loader(ObjectUtil.clone(source));
There is no error in the code as such, nothing wrong with the syntax, it will work fine if source is a Loader.
What error message do you get?
精彩评论