createEmptyMovieClip no more!!!

It has some months the ActionScript 3.0 this available one so that the developers know the new language of the Adobe/Macromedia. Rewrite practically of the zero. One of the changes it is that it was removed the methods “createEmptyMovieClip”,”attachMovie” among others. The questions, who use these methods in its scripts (like me), will have that to adapt for the new language.

Example create movieclip in action script 2.0 and load one image.
[as]class CreateMC_AS2 extends MovieClip {
var container:MovieClip;
public function CreateMC_AS2() {
container = _root.createEmptyMovieClip(“container”, this.getNextHighestDepth());

Example create movieclip in action script 3.0 and load one image.
[as]package {
import flash.display.MovieClip;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.util.trace;
public class CreateMC extends MovieClip {
[Embed(source=’c:\super.jpg’)] public var MyImage:Class;//the image in C:\
public function CreateMC() {
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
var img:MyImage = new MyImage();

ActionScript 3

Migrating Applications to Flex 2

Leave a Reply