-3

我使用这段代码:

parantClip.childClip1.stop();
parantClip.childClip2.stop();
parantClip.childClip3.stop();
parantClip.childClip4.stop();
parantClip.childClip5.stop();
parantClip.childClip6.stop();
parantClip.childClip7.stop();
parantClip.childClip8.stop();

但我想这样做:

for(var k:int=1; k<9; k++)
    MovieClip(root).parentClip.["childClip"+k].stop();

我怎样才能做到这一点?

4

1 回答 1

0

尝试这个:

(parantClip["childClip" + k] as MovieClip).stop();
于 2013-11-02T08:42:08.207 回答