开发者

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?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜