PDA

View Full Version : 2.0 script to 3.0 createEmptyMovieClip question



vanderwaal
August 1st, 2008, 12:28 PM
trying to make the leap from 2.0 to 3.0.

wanna help me? i need to know how the following would be written in 3.0.


_root.createEmptyMovieClip("container_mc",_root.getNextHighestDepth());

Favardin
August 1st, 2008, 12:32 PM
In general like this (if you need the name):


var container:MovieClip = new MovieClip();
container.name = "container_mc"; // only if you need to address this by name later on
stage.addChild( container );


Whereas "stage" can be substituted by any DisplayObjectContainer (http://livedocs.adobe.com/flex/2/langref/flash/display/DisplayObjectContainer.html) (that includes other movieclips)