0

I tried to use createjs to create a movieClip and add an image inside it like this:

rect2 = new Bitmap(_preloader.getResult("rect").result);
mv = new MovieClip("single", 0, false, []);
mv.addChild(rect2);
_stage.addChild(mv);

I expect to see rect2 on stage, but it dose not show up, if I added rect2 to stage it will show up, so what's I am missing here?

simo
  • 23,342
  • 38
  • 121
  • 218
  • What platform are you targeting ? How are you compiling it ? How is that related with createjs ? – blue112 Feb 21 '13 at 10:41
  • I am targeting HTML5, compiling it using haxe nme, createjs is a library that has as3 apis to create graphics and interactivity, can't you see that I am using it in the code above? – simo Feb 21 '13 at 12:07

1 Answers1

0

Is there any reason you are using MovieClip? It is mainly used to handle export from Flash Pro using Toolkit for CreateJS.

Instead, you might try using a Bitmap instance, which wraps an image, canvas, or video element.

One note for MovieClips is that you need to gotoAndStop/gotoAndPlay in order to set the initial state, it does not "default" to the first frame like Flash.

Lanny
  • 11,244
  • 1
  • 22
  • 30