This content has been marked as final. Show 5 replies
Yep, and it's not that tough to do either.
Create a new movie, and 3 input text fields. Name them dollar_txt, percent_txt, and result_txt.
Create a new layer, lock it, name it actions, and place the following code on it.
Hmmm. that didn't appear to do anything. Would you mind taking a look at my application? I posted it here:
and here is my code - i'm trying to allow a user to input an increase using a % or a dollar (middle section). If they choose percent, it should calculate the dollar field. And vise-versa, if they want to use a dollar amount, it should update the percent field.
When re-creating my example, make sure that you're not using textField components, just use plain textFields.
The way the example works is - you type in 50000 into box 1 (dollar_txt) and a percent into box 2 (percent_txt) and box 3 will auto-update as you are typing. If you change box 3 (from 3500, to 4000 for example), the percent box will auto update with the new percentage.
Wow, noone has ever tried this? I thought for sure it would be a slam-dunk for script kiddies
I think I'm having a hard time understanding you because you keep changing the names of things you're referencing.
Is the total_txt that you're referring to the textField beside where it says New Annual Salary / OTE? Because otherwise I have no idea what textfield you're referring to. I sent you an FLA via e-mail this morning - did you receive it?
You state that you want your application to perform the following:
1) allow input for both (percent & dollar)
2) recalculate the percent if you change the dollar and vise-versa, recalculate the dollar value if you change the percent.
What am I missing here.. ? Isn't that exactly what it's doing?
In the Current Annual Base / OTE you start with 50000.
In recommended salary increase , percentage is set to 5, and dollar updates itself to become 2500 (5% of 50000)
If I change the value in percent to 7, the value under dollar changes from 2500 to 3500. (7% of 50000)
If I then change 3500 to 6500, the percent field changes to 13. (6500 = 13% of 50000).