[英]addchild in a movieclip in a movieclip in a movieclip
I would addchild to a movieclip who is in a movieclip who is in another movieclip. 我会将childchild添加到另一个剪辑中的movieclip中。
I try: 我尝试:
this.profil.bonome0.bonome.addChild(conteneurImage);
and it doesn't work but this does: 它不起作用,但这可以:
this.profil.bonome0.addChild(conteneurImage);
how could I access to the third movieclip (bonome)? 如何访问第三个动画片段(bonome)?
Your syntax is perfectly fine and your code should work, assuming the following: 您的语法非常好,并且您的代码应该可以正常工作,并假设以下情况:
profil
exists in the current context. profil
的MovieClip。 bonome0
exists within profil
. bonome0
中存在profil
。 bonome
exists within bonome0
. bonome
的MovieClip存在于bonome0
。 Point 3 is where you seem to be having trouble, so check to be sure that you have a MovieClip nested inside bonome0
with the instance name bonome
. 第三点是,你似乎遇到了问题,所以检查,以确保您有嵌套在影片剪辑
bonome0
与实例名称bonome
。
To debug, you can trace each of the MovieClips until you hit undefined
, which will mean you don't have a MovieClip nested with the instance name you're trying to access it by. 要进行调试,您可以跟踪每个MovieClip,直到您点击
undefined
为止,这意味着您没有将MovieClip嵌套在尝试访问它的实例名称上。 eg 例如
trace(
profil,
profil.bonome0,
profil.bonome0.bonome
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.