本文介绍了HTML5画布/ Flash。如何访问儿童影片剪辑,并使其gotoAndPlay?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Flash中,我在主时间轴上有两个帧。第一个是选择一种语言,第二个包含一个导航栏。
这个导航栏是一个movieclip,其中包含项目(movieclip)。这些item-movieclip包含两个帧:每个语言一个。



在navigation-bar-movieclip里面,我想控制所有的孩子动画片段并将它们设置为正确的(取决于用户选择的语言)。



我使用这段代码(在navigation-bar-movieclip的时间轴内):

  this.item.gotoAndStop(en); 

但是这样做不行,哪个是蠢!

获得这项工作的最佳解决方案是什么? (我不害怕在闪存外面写代码,但是我不知道怎么做!)

有什么建议吗?

有时也许我想更深入地使用... this.navbar.item.child-item.gotoAndPlay(blob);

(顺便说一句,我正在使用这些工具包for createjs或flash cc html5 canvas技术。)

解决方案

我找到了解决方案:

我发现你可以访问事件中的movieclip children。所以我去打勾。

  var self = this; 
$ b this.on(tick,function()
{
self.myChildren_mc.childrensChildren_mc.gotoAndStop(3); // WORKS !!!
} ,null,true); //如果是真的,它只会被触发一次!

在某些情况下,您必须先删除侦听器。


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

解决方案

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.

这篇关于HTML5画布/ Flash。如何访问儿童影片剪辑,并使其gotoAndPlay?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 16:25