简体   繁体   English

Adobe Flex简单计算器

[英]Adobe Flex simple calculator

Hello everyone. 大家好。 I built a program in Flex Builder back in 2011. I have since lost the project files for it and I am trying to rebuild it. 我早在2011年就在Flex Builder中构建了一个程序。此后,我已经失去了它的项目文件,而我正试图对其进行重建。 At one point, I knew how to do this, but for one reason or another, how I pulled it off now escapes me. 一方面,我知道如何执行此操作,但是由于某种原因,我如何将其退出现在让我感到困惑。 It's really incredibly simple. 这真的非常简单。

  • textInput 1 textInput 1
  • textInput 2 textInput 2
  • textInput 3 textInput 3

dynamic label for result x 结果x的动态标签

In my original, the user would input values into the three boxes, as the values were entered for each box the label would read "n/a", once the final value was input it automatically populated the label with the result of the math. 在我的原始作品中,用户将值输入到三个框中,因为在为每个框输入值时,标签将显示为“ n / a”,一旦输入了最终值,它将自动用数学结果填充标签。 In this particular case, it would be: 在这种情况下,将是:

x = (input1/(60/input2))/input3 x =(输入1 /(60 /输入2))/输入3

I am not a programmer, and there have been some changes since I accomplished this last. 我不是程序员,自从我完成以上工作以来,已经发生了一些变化。 I've tried starting over from scratch, but I can't seem to get a working result. 我已经尝试从头开始,但似乎无法获得有效的结果。 If someone could help crash me through this one calculation I can proceed again on my own, I just need a refresher. 如果有人可以帮助我完成一次计算,那么我可以自己继续进行下去,我只需要复习一下即可。 Thank you in advance! 先感谢您!

I guess something like that may help you. 我想类似的东西可能会对您有所帮助。

private function SomeMath():void
{
    dynamicTextBox.text = (input1.text/(60/input2.text))/input3.text;
}

and all these dynamicTextBox , input1 , input2 , and input3 are the id s which are defined at correspoding part of mxml file. 所有这些dynamicTextBoxinput1input2input3是在mxml文件的相应部分定义的id

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

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