在Flash:gotoAndStop和嵌套影片剪辑的问题 [英] In Flash: gotoAndStop and nested MovieClip issues

查看:318
本文介绍了在Flash:gotoAndStop和嵌套影片剪辑的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是种一个奇怪的问题,我希望这足够的信息去:

This is kind of an odd question, I hope this enough information to go on:

在闪光灯的IDE,我有一个影片剪辑,有3张。在每一帧,我有一系列TextField的。这是一个可怜的男人的ViewStack的基本 - 所以这里的问题 - 在FP10我可以写下面的code没有问题:

In the flash IDE, I have a MovieClip that has 3 frames. In each frame, I have a series of TextFields. It's a poor mans viewstack basically - so here's the issue - in FP10 I can write the following code with no problem:

public function showMenu():void{

     gotoAndStop(2);
     textItem.text = "This worked."

}

,其中本是一个影片剪辑和textItem是一个文本字段,这只是在影片剪辑的第二帧。如果我的目标FP9并运行相同的code,我得到一个1009错误有关试图引用属性的对象,它是空的。

where "this" is a MovieClip and textItem is a TextField that is only on the second frame of the movieClip. If I target FP9 and run the same code, I get a 1009 Error about trying to reference a property on an object that is null.

据我所知,这是试图访问属性之前,它完全实例化,我不明白的是,为什么它在FP10,而不是FP9?还有什么比在Flash Player中已经更改为允许这样做?

I understand that it is trying to access that property before it was completely instantiated, what I don't understand is why it works in FP10 and not FP9? What could have changed in the flash player to allow this?

更新:

看起来像FP9一些怪事 - 一种解决方法可以在这里找到:

Looks like some weirdness in FP9 - a workaround can be found here:

<一个href="http://www.scottgmorgan.com/blog/index.php/2008/03/06/accessing-displayobjects-on-the-timeline-after-a-gotoandstop-or-gotoandplay/" rel="nofollow">http://www.scottgmorgan.com/blog/index.php/2008/03/06/accessing-displayobjects-on-the-timeline-after-a-gotoandstop-or-gotoandplay/

推荐答案

是的,它已经改变了。这的的可能在A​​S2消失在AS3中,采取多短的时间线脚本与它的简单性。因此,它被复原的FP10。我看过有人在土坯这个博客文章,但我无法找到它现在。

Yes, it has changed. This was possible in as2 but disappeared in as3, taking much of the simplicity of shorter timeline scripts with it. So, it was reinstated in FP10. I've read a blog post by someone at adobe about this, but i can't find it right now.

这篇关于在Flash:gotoAndStop和嵌套影片剪辑的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆