CreateJS-Haxe icon indicating copy to clipboard operation
CreateJS-Haxe copied to clipboard

Why MovieClip is not visible?

Open hopewise opened this issue 13 years ago • 4 comments

I tried 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?

I need to be able to add multiple images as layers inside movieClip to be able to move them as a group, is this the recommended way to do it?

hopewise avatar Feb 12 '13 09:02 hopewise

Looks like CreateJS MovieClip class cannot be used as container (despite the fact that it extends Container class). You can still use common container for both mv and rect2. For instance:

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

nickalie avatar Feb 14 '13 11:02 nickalie

Thanks, I have tested the container, it worked, notice that any line after mv = new MovieClip("single", 0, false, []); will not be reached, it seems that an error occurs inside the constructor of MovieClip?

Also, I tried this code from http://www.atari.com, but I got that cp is not defined, possible that its a new function not implemented in the extern?

var logo = new createjs.Graphics() .beginFill("#ff0000") .moveTo(37,3).lineTo(41,3).lineTo(41,23) .quadraticCurveTo(41,62,8,68) .lineTo(8,59).quadraticCurveTo(37,53,37,3).cp() .dr(44,3,10,65) .moveTo(61,3).lineTo(57,3).lineTo(57,23) .quadraticCurveTo(57,62,90,68) .lineTo(90,59).quadraticCurveTo(61,53,61,3).cp()

On Thu, Feb 14, 2013 at 1:07 PM, nickalie [email protected] wrote:

Looks like CreateJS MovieClip class cannot be used as container (despite the fact that it extends Container class). You can still use common container for both mv and rect2. For instance:

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

— Reply to this email directly or view it on GitHubhttps://github.com/nickalie/CreateJS-Haxe/issues/7#issuecomment-13542740.

Kind Regards,

Samir Sabri Software Architect& Developer www.dcaclab.com Jordan-Middle East

hopewise avatar Feb 14 '13 11:02 hopewise

  1. According CreateJS docs there is no such mode MovieClip as "simple". http://www.createjs.com/Docs/EaselJS/classes/MovieClip.html
  2. cp - is shortcut for closePath. Shortcuts are not implemented in CreateJS-Haxe. http://www.createjs.com/Docs/EaselJS/classes/Graphics.html

nickalie avatar Feb 14 '13 11:02 nickalie

Here is what they say for MovieClip property:

SINGLE_FRAME Stringhttps://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String static

Defined in SINGLE_FRAME:66http://www.createjs.com/Docs/EaselJS/files/.._src_easeljs_display_MovieClip.js.html#l66

Read-only. The MovieClip will only display a single frame (as determined by the startPosition property).

Default: "single"

I think I typed it "simple" in my unconscious mind :-)

How would I add the cp shortcut to the CreateJS-Haxe? On Thu, Feb 14, 2013 at 1:53 PM, nickalie [email protected] wrote:

  1. According CreateJS docs there is no such mode MovieClip as "simple". http://www.createjs.com/Docs/EaselJS/classes/MovieClip.html
  2. cp - is shortcut for closePath. Shortcuts are not implemented in CreateJS-Haxe. http://www.createjs.com/Docs/EaselJS/classes/Graphics.html

— Reply to this email directly or view it on GitHubhttps://github.com/nickalie/CreateJS-Haxe/issues/7#issuecomment-13544329.

Kind Regards,

Samir Sabri Software Architect& Developer www.dcaclab.com Jordan-Middle East

hopewise avatar Feb 14 '13 14:02 hopewise