问题
In Flash I have 2 frames in the main-timeline. The first one is to select a language and the second one contains a navigation-bar. this navigation-bar is a movieclip, which contains items (movieclips). Those "item-movieclips" contain 2 frames: one for each language.
Inside the navigation-bar-movieclip I want to control all children movieclips and set them to the correct frame (depending on which language the user has chosen).
I'm using this code (inside the timeline of the navigation-bar-movieclip):
this.item.gotoAndStop("en");
But this does not work, which is stupid!
What is the best solution to get this work? (I'm not afraid to write the code outside flash, but I don't know how!)
Any suggestions?
Sometimes maybe I want to go deeper and use … this.navbar.item.child-item.gotoAndPlay("blob");
(BTW, I'm using those "toolkit for createjs" or "flash cc html5 canvas" technique.)
回答1:
ok, guys. I found the solution:
I found out that you can have access to movieclip children inside events. so I go for "tick".
var self = this;
this.on("tick", function()
{
self.myChildren_mc.childrensChildren_mc.gotoAndStop(3); // W O R K S !!!
}, null, true); //if true, it's only fired once!
in some cases you have to remove the listener before.
来源:https://stackoverflow.com/questions/20871538/html5-canvas-flash-how-to-access-children-movie-clip-and-make-it-gotoandplay