Skip to main content
Participant
April 17, 2008
Answered

Moving around timeline causing movieclips to duplicate

  • April 17, 2008
  • 3 replies
  • 566 views
Something in my flash file is causing a movieclip to duplicate. I think it's down to calling gotoAndPlay. I don't have a way in AS2 to check the children of the parent and maybe remove the duplicate movieclip. Anybody come across something similar?

Just to describe the problem in more detail. I have a series of pages. When you click through to a new page the previous page moves to the site but a little bit sticks out so you can bring it back again. On a page you click on a button to go onto a new page. The third time I do this a duplicate of the page I'm moving away seems to appear. The duplicate moves out of the way (with none of the components initialised) and the original stays overlaying the page that should be showing. I'm not going to the keyframe where the MC appears so I don't know why it's being duplicated.
This topic has been closed for replies.
Correct answer markh
The problem was I was setting the depth of the authoring-time movieclips to a specific depths. It looks like when flash moved to a new place on the timeline it thought the MCs were missing and re-created them. What I should have done was something like this: mc1.swapDepths(mc2)

3 replies

kglad
Community Expert
Community Expert
April 17, 2008
your movieclips are still there when you use swapDepths(). you're just probably not seeing the ones at lower depths.
markhAuthor
Participant
April 17, 2008
I've created a function that removes duplicates, a temporary work-around.
kglad
Community Expert
Community Expert
April 17, 2008
are even using actionscript to create any of your movieclips? if not, you have a keyframe that's duplicated something.
markhAuthorCorrect answer
Participant
April 17, 2008
The problem was I was setting the depth of the authoring-time movieclips to a specific depths. It looks like when flash moved to a new place on the timeline it thought the MCs were missing and re-created them. What I should have done was something like this: mc1.swapDepths(mc2)