Skip to main content
Inspiring
April 22, 2006
Answered

duplicateMovieClip with externaly loaded movie

  • April 22, 2006
  • 1 reply
  • 358 views
Hi

the function duplicateMovieClip gives me a real hard time.
I dynamically load certain parts of my application using the MovieClipLoader, then (when the external movieclip is completely loaded and intialized) I try to duplicate this movieclip using the duplicateMovieClip function, but it doesn't work.
Using the function on a movieclip that has been created at design time or using createEmptyMovieclip work, but not with the externaly loaded ones.

Is this some kind of security problem? How can it be solved.

Any help is appreciated.
Thanks in advance
Paul
This topic has been closed for replies.
Correct answer kglad
the movieclip can be in any library. but if it's not in the swf that contains the duplicateMovieClip() statement, you'll need to use shared assets.

is there any browser in which you can eliminate the cache? i know you can limit the cache space, but unless your swf contains a graphic which is a substantial fraction of 1 mb, i don't think repeated downloading is a realistic concern.

1 reply

kglad
Community Expert
Community Expert
April 22, 2006
it's not a security problem. it's just something that flash doesn't support.

to duplicate a movieclip it will need to be in a flash library.
Inspiring
April 23, 2006
quote:

it will need to be in a flash library.

Does this mean it needs to be in _a_ flash library or in _the_ flash library of the main movie?
In other words, could I mark the part of the external movielcip to be exported as actionscript variable and then use it with duplicate movieclip in the main movie? or is there any workaround to achieve the goal of having externaly loaded parts of an application to be duplicatable?
Right now I do another loadMovieClip for every instance of the layout part instead of duplicating the previously loaded one. I guess as long as caching is enabled in the surrounding browser this is not a big problem, but if the cache is turned of I guess this solution will result in a lot of traffic slowing the application down.
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
April 23, 2006
the movieclip can be in any library. but if it's not in the swf that contains the duplicateMovieClip() statement, you'll need to use shared assets.

is there any browser in which you can eliminate the cache? i know you can limit the cache space, but unless your swf contains a graphic which is a substantial fraction of 1 mb, i don't think repeated downloading is a realistic concern.