简体   繁体   English

在Flash CS5中向按钮符号帧添加动作

[英]Adding Actions to Button Symbol frames in Flash CS5

For some reason I can't add ActionScript actions to a timeline frame within a Button Symbol, like I normally would with MovieClip symbols or on the stage. 由于某些原因,我无法像在MovieClip符号或舞台上那样,将ActionScript操作添加到按钮符号内的时间轴帧。 The Actions panel shows this message: “动作”面板显示以下消息:

"In ActionScript 3.0, code cannot be placed directly on objects. Please select a frame..." “在ActionScript 3.0中,无法将代码直接放置在对象上。请选择一个框架...”

even though I definetely have a frame selected! 即使我确实选择了一个框架!

Any ideas? 有任何想法吗?

EDIT: Screenshot as requested. 编辑:按要求截屏。 As you can see, a frame is clearly selected... 如您所见,明确选择了一个框架... 替代文字

You can't add code to the frames of buttons because they are not actually frames. 您不能将代码添加到按钮框架中,因为它们实际上并不是框架。 The buttons you create on stage are instances of the SimpleButton class . 您在舞台上创建的按钮是SimpleButton 类的实例。

From the documentation of the class you can see that it does not inherit from MovieClip so it has no frames. 从该类的文档中,您可以看到它没有从MovieClip继承,因此它没有框架。 It's just that the IDE makes it kinda look like frames. 只是IDE使它看起来有点像框架。 The solution is to make them MovieClips. 解决方案是使它们成为MovieClips。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM