[英]AS3 Button that works for all Scene/Frame (Flash CS6)
Alright, I have a difficult problem "for me" , I'm a beginner in Adobe Flash CS6. 好吧,我有一个“对我而言”的难题,我是Adobe Flash CS6的初学者。
The Problem 问题
I can't make the button works for all frame. 我无法使按钮在所有画面上都有效。 I was unable to click once I jump to another frame or scene.
跳转到另一个帧或场景后,我无法单击。
The Explaination 讲解
I'll explain more detail what I'm trying to do with the button. 我将更详细地说明我要使用该按钮做什么。
I Have have a button which is named "Back to Menu" that placed in "Play" Scene, the button supposed to get the user back to the menu. 我有一个名为“返回菜单”的按钮,该按钮位于“播放”场景中,该按钮应该可以使用户返回菜单。
The code is placed on frame 1, in the "Play" Scene and the code used is : 该代码位于“播放”场景中的第1帧上,使用的代码为:
backtomenu.addEventListener(MouseEvent.CLICK, backmenuClick); function backmenuClick(ev:MouseEvent):void { gotoandPlay ("Main Menu"); }
Is there any other way to make the code readable to all frame? 还有其他方法可以使代码对所有框架都可读吗? or make a universal button?
或制作一个通用按钮? Because I know the code wasn't read when I was at the 2nd Frame in the "Play" Scene.
因为我知道在“播放”场景中的第二帧时未读取代码。 do I have to make a different code for each frame?
我必须为每个帧制作不同的代码吗? if that so, that's insane.
如果那样的话,那太疯狂了。
You can put your "Back to Menu" button on a new layer with 1 keyframe & 9 frames to cover the whole "Play" scene. 您可以将“返回菜单”按钮放在具有1个关键帧和9个帧的新图层上,以覆盖整个“播放”场景。 Your "backtomenu.addEventListener" code needs to be placed in the keyframe of the new layer.
您的“ backtomenu.addEventListener”代码需要放置在新层的关键帧中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.