Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.18 / 5.00 3,534 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.80 / 5.00 4,200 ViewsHello, I'm a real nub when it comes to actionscript.
I'm trying to make some sort of calculator but I dont know how I can
change the output in my dynamic text field when a value from the input changes.
Is this with on(change) or something?
And how do I script with text fields?
I have experience in Java and C and I'm using AS2.0 because otherwise I couldn't
give variables to my text fields and CS5.
At 7/25/10 10:06 AM, DikkeHamster wrote: Hello, I'm a real nub when it comes to actionscript.
I'm trying to make some sort of calculator but I dont know how I can
change the output in my dynamic text field when a value from the input changes.
Is this with on(change) or something?
And how do I script with text fields?
I have experience in Java and C and I'm using AS2.0 because otherwise I couldn't
give variables to my text fields and CS5.
I'm also doing a calculator, for do the calculated number I did:
var calculated:Number = 0;
Than for add the number I did:
one_num.onPress = function(){
_root.keyOn = "one";
if(keyOn == "one"){
add_num.onPress = function(){
_root.calculated = calculated + 1;
}
less_num.onPress = function(){
_root.calculated = calculated - 1;
}
}
What I did was, that pressing "1" on the calculator, it activate the variable keyOn, than keyOn identify for me what number is, so I did "one", than if is one, pressing on the button with "+" he add 1 and pressing on the button with "-" he subtract 1. I also did division and multiplication, than you use / and *.
Hope this helped.
SpyS.
Hmm, but I don't want to work with any buttons, maybe just a reset one.
And it's not really a mathematical calculater, it's for an mmo.
So one just needs to fill in how many units of this gives that amount of rating.
Anyway, thanks, maybe I can still use your method!
At 7/25/10 10:34 AM, DikkeHamster wrote: Hmm, but I don't want to work with any buttons, maybe just a reset one.
And it's not really a mathematical calculater, it's for an mmo.
So one just needs to fill in how many units of this gives that amount of rating.
Anyway, thanks, maybe I can still use your method!
For the reset button like the "Ce" from the calculator is pretty simple, is just:
ce_btn.onPress = function(){
_root.calculated = 0;
}
SpyS.
At 7/25/10 10:34 AM, DikkeHamster wrote: Hmm, but I don't want to work with any buttons, maybe just a reset one.
And it's not really a mathematical calculater, it's for an mmo.
So one just needs to fill in how many units of this gives that amount of rating.
Anyway, thanks, maybe I can still use your method!
I think you need to explain better in detail what you are trying to do. Your first post indicates that you want to make a calculator, i.e. where user inputs numbers and the calculator outputs the result. But this post now seems to indicate something different. So please explain better what you exactly want to do.
You can solve pretty much any problem you may have with AS3 by consulting the AS3 Language reference.