arrays - Why cant I use a loaded movieclip at the same time on two locations? -
i'm loading swf, place in array , use in various locations.
everything works should, when add movieclip in 2 different places @ same time (in different classes), displayed on 1 location.
i don't error, shows once.
this how load swf , add array:
img.contentloaderinfo.addeventlistener(event.complete, loaded); url = new urlrequest("my_file.swf"); img.load(url); function loaded(event:event):void{ var mc:movieclip = event.target.content movieclip; testarr.push(mc); }
and how display movieclip:
var displaymc:movieclip = movieclip(myclass.testarr[0]); addchild(displaymc); var otherymc:movieclip = movieclip(myclass.testarr[0]); addchild(otherymc);
should duplicate movieclip in array able display on 2 locations or doing wrong?
you can't display 1 movieclip in 2 different places. yes, should duplicate movieclip. try code:
var duplicatedimg:loader = new loader(); duplicatedimg.contentloaderinfo.addeventlistener(event.complete, loaded); duplicatedimg.loadbytes(img.contentloaderinfo.bytes);
Comments
Post a Comment