Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why MovieClip is not visible? #7

Open
hopewise opened this issue Feb 12, 2013 · 4 comments
Open

Why MovieClip is not visible? #7

hopewise opened this issue Feb 12, 2013 · 4 comments

Comments

@hopewise
Copy link

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?

@nickalie
Copy link
Owner

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);

@hopewise
Copy link
Author

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//issues/7#issuecomment-13542740.

Kind Regards,

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

@nickalie
Copy link
Owner

  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

@hopewise
Copy link
Author

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//issues/7#issuecomment-13544329.

Kind Regards,

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants