If 语句帮助 - Flash Actionscript 2.0
这可能是一个不太可能的机会,因为我很难清楚地表达我正在尝试的事情,但无论如何我都会尝试。 :)
我的整体概念是一个基本(非常基本)的游戏;您有原料(其中 4 种),根据您选择的原料,最终产品(在本例中为蛋糕)看起来会有所不同。
例如:如果您单击“蛋糕混合”按钮、“巧克力”按钮和“水”按钮,您将获得巧克力蛋糕。但如果你只点击“蛋糕混合”按钮和“水”按钮,你就会得到香草蛋糕。
我不知道如何编码,以便根据单击的按钮获得不同的结果。有什么想法吗? =/
有一个“REVEAL”按钮,我将所有脚本放在上面。现在我有:
on (release) {
if (_root.buttons.water._visible == false);
gotoAndPlay(384);
if (_root.buttons.water._visible == true);
gotoAndPlay(383);
}
我想说的是,如果在任何时候点击了水按钮,则转到此结果(第 384 帧)。但如果尚未单击水按钮,请转到此结果(第 383 帧)。
希望有人有一个想法我可以尝试! :)
我正在使用 Flash CS5 和 Actionscript 2.0。谢谢你!
This is probably going to be a long shot, because I'm having trouble articulating what I'm attempting, but I will try anyway. :)
My overall concept is a basic (very basic) game; you have ingredients (4 of them) and depending on which ones you choose, the final product (in this case, a cake) looks different.
For example: if you click the "cake mix" button, the "chocolate" button and the "water" button, you get CHOCOLATE CAKE. But if you only click the "cake mix" button and the "water" button, you get VANILLA CAKE.
I have no idea how to code it so that, depending on which buttons are clicked, you get a different outcome. Any ideas? =/
There is a "REVEAL" button that I'm putting all of the script on. Right now I have:
on (release) {
if (_root.buttons.water._visible == false);
gotoAndPlay(384);
if (_root.buttons.water._visible == true);
gotoAndPlay(383);
}
I'm trying to say, if at any point the water button is clicked, go to THIS OUTCOME (frame 384). But if the water button HASN'T been clicked, go to THIS OUTCOME (frame 383).
Hopefully someone has an idea I can try! :)
I am using Flash CS5 and Actionscript 2.0. Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要首先为每个按钮设置一些状态变量,以跟踪已单击的内容和未单击的内容。类似于:
当其中之一被释放时,将其变量切换为“true”。
那么检查中的 if 语句应该如下所示:
You probably need to set some state variables for each button first, to keep track of what's been clicked and what hasn't. Something like:
When one of these is released, change switch its variable to "true".
Then the if statements in your check should look something like this: