Issue converting old AS2 code to AS3 to make a calculator work.
I would be very grateful for any suggestions in getting this original AS2 calculator script to run as AS3 as am having problems getting Math functions to execute along with Incorrect Input function.
I have 4 Input Text fields: speed, hook, area and drag. also a dynamic Text field: total_txt with a calculate and clear and close btn.
// create permissible variable to ensure field is cleared on application load
permissible = "";
calculate_btn.onPress = function() {
// execute script to calculate values
if (speed>0 && hookload>0 && area >0 && drag >1.19999){
permissible = Math.round(Math.sqrt(hookload*1.2/(drag*area))*speed*100)/100
var num = String(permissible);
if(permissible > speed) permissible = speed;
}else{
//issue message if incorrect input
permissible = "Incorrect Input";
}
}
clear_btn.onPress = function(){
//clear named fields
permissible = "";
speed="";
hookload="";
area="";
drag="";
}
close_btn.onRelease=function(){
//unload this movie
unloadMovie("");
}
Thanks in advance.
