I would like to be able to draw a simple box as a background/placeholder, dress it up with buttons and movie clips at design time, and at runtime call a function to replace the simple box with the new design. How would I go about doing this?
I have a graphic design that is too complicated to make with flash. So i made a piece of actionscript that can restyle any existing movieclip. This piece of code works.
It basically gets the coordinates of the specified mc, creates a new one in it’s place and deletes the original.
**Unfortunately **this also removes any nested movieclips and buttons and breaks animation tweens of this mc. So if the original mc would have a button on it and animates from left to right, the new one doesn’t.
[LIST]
[*]mc.clear(); looked very promising, but it only clears stuff you put on it at runtime while I need to clear the stuff from design-time. (= the simple box drawing object)
[/LIST]
[LIST]
[*]Creating a movieclip with the same name, at the same depth doesn’t seem to work.
oldbox.parent.createEmptyMovieClip(oldbox._name, oldbox.getDepth());
The old movieclip keeps existing and neither of them animates.
[/LIST]
So I’m searching for a way to replace a movieclip or clear it’s content at runtime.
Or am I thinking in the wrong direction and are there other ways to restyle a movie clip?