开发者

Syntax Error in ActionScript function

开发者 https://www.devze.com 2023-01-28 19:15 出处:网络
开发者_开发百科it seems there is an error in the code below, but where? function cloneLoader(source:Loader):Loader
开发者_开发百科

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消