Copy link to clipboard
Copied
How to create a new movie clip using HTML5 code.
And add movie clips to the Stage.
I also need to name movie clips.
var mc = new createjs.MovieClip();
mc.name="mc_name";
this.addChild(mc);
I don't think you can access a movieclip using a property value that you have set. And Animated_Container is a variable that belongs in the current context, exportRoot doesn't know about that variable either.
If you need everything to be global, you could do this:
exportRoot.Animated_Container = new createjs.MovieClip();
exportRoot.Animated_Container.name = "Co_name";
exportRoot.addChild(exportRoot.Animated_Container);
exportRoot.Animated_Container.addChild(new createjs.MovieClip());
The name pr
...Copy link to clipboard
Copied
var mc = new createjs.MovieClip();
mc.name="mc_name";
this.addChild(mc);
Copy link to clipboard
Copied
Thank you for your reply.
I use that name.(exportRoot.this name)
But the name is undefined
var Animated_Container = new createjs.MovieClip();
Animated_Container.name="Co_name";
exportRoot.addChild(Animated_Container);
console.log(exportRoot.Co_name)
exportRoot.Co_name.addChild(new lib.child_mc1());
Copy link to clipboard
Copied
I don't think you can access a movieclip using a property value that you have set. And Animated_Container is a variable that belongs in the current context, exportRoot doesn't know about that variable either.
If you need everything to be global, you could do this:
exportRoot.Animated_Container = new createjs.MovieClip();
exportRoot.Animated_Container.name = "Co_name";
exportRoot.addChild(exportRoot.Animated_Container);
exportRoot.Animated_Container.addChild(new createjs.MovieClip());
The name property won't be needed.
What's the reason you need to involve exportRoot?
Copy link to clipboard
Copied
Thank you for your answer.
When I learn that I cannot use the instance name,
I will think about other ways.
Thank you again.
I want to create containers in bulk. Then batch control.
The container is part of the direct drawing, part of the code generation.
I want to do an array or object operation on a container.
What is loaded into the container is a different operation.
Copy link to clipboard
Copied
you're welcome
Copy link to clipboard
Copied
everything from the console.log and below is wrong and unrelated to anything suggested by me.
Copy link to clipboard
Copied
Thank you for your answer.
It helped me a lot, thank you.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now