|
|
|
#1 |
|
Relaxing
Join Date: Oct 2001
Location: colorado, usa
Posts: 1,712
|
Conversion Calculator
http://www.diversioncentral.com/calc...nversions.html
I was thinking of putting this on the koolexchange. If you see a problem or bug, please let me know.
__________________
Any programming language is at its best before it is implemented and used. |
|
|
|
|
|
#2 |
|
up to my .as in work
Join Date: Dec 2004
Posts: 4,364
|
Cool.
Only suggestion I have is to restrict the input fields to numbers only. Great job Tim |
|
|
|
|
|
#3 | |
|
Relaxing
Join Date: Oct 2001
Location: colorado, usa
Posts: 1,712
|
Quote:
__________________
Any programming language is at its best before it is implemented and used. |
|
|
|
|
|
|
#4 |
|
up to my .as in work
Join Date: Dec 2004
Posts: 4,364
|
If they enter a letter the conversion will return "NaN" (not a number). It's not a big deal and doesn't affect function so forget I mentioned
__________________
KM-CODEX - Resources for Koolmoves Users in-R-tube Free YouTube Search-View-Retrieve Tool made With SWF Studio & Koolmoves 7 Last edited by Chris_Seahorn; 11-14-2006 at 10:03 PM. |
|
|
|
|
|
#5 |
|
Relaxing
Join Date: Oct 2001
Location: colorado, usa
Posts: 1,712
|
See what you mean Chris. This is why I posted. Looking for all the mistakes. I will repost when done. This application whould be worthless without your help.
__________________
Any programming language is at its best before it is implemented and used. |
|
|
|
|
|
#6 | |
|
up to my .as in work
Join Date: Dec 2004
Posts: 4,364
|
Quote:
|
|
|
|
|
|
|
#7 |
|
That web bloke
Join Date: Jan 2006
Location: England
Posts: 869
|
Great idea, could use something like that on my sites as a "stcky resource" or logo it up as a download as a projector with the site name on. Great thinking, please put in the exchange.
|
|
|
|
|
|
#8 |
|
KoolMoves Moderator
Join Date: Jul 2001
Location: Atlanta GA
Posts: 4,912
|
Tmoore You might either not allow the result field to be edited, OR consider allowing one to do both like Gallon to Liter and liter to gallon and use the event onChanged to know wich direction to do the calculation.
Here's a code snippet to consider Code:
txt1.restrict = "0-9\u002E";
txt2.restrict = "0-9\u002E";
txt1.onChanged=function(){
if (txt1.text!=""){
txt2.text=txt1.text*3.7853
}
}
txt2.onChanged=function(){
if(txt2.text!=""){
txt1.text=txt2.text*.2642
}
}
And which ever box you edit the other shows the calulated value |
|
|
|
|
|
#9 |
|
up to my .as in work
Join Date: Dec 2004
Posts: 4,364
|
Yeah...good call. Once this baby is ready I want one
|
|
|
|
|
|
#10 |
|
Relaxing
Join Date: Oct 2001
Location: colorado, usa
Posts: 1,712
|
I could change this before I submit. It would also reduce the amount of buttons.
But I do not understand the txt1.restrict = "0-9\u002E";
__________________
Any programming language is at its best before it is implemented and used. |
|
|
|
|
|
#11 |
|
up to my .as in work
Join Date: Dec 2004
Posts: 4,364
|
That is the unicode escape equivilent of "." (period).
You could also use: txt1_txt.restrict = "0-9 ."; or txt1_txt.restrict = "0-9, ."; etc |
|
|
|
|
|
#12 |
|
Relaxing
Join Date: Oct 2001
Location: colorado, usa
Posts: 1,712
|
Ok. I guess the forwardslash made it look like an equation or something.
Thanks all.
__________________
Any programming language is at its best before it is implemented and used. |
|
|
|
|
|
#13 |
|
Relaxing
Join Date: Oct 2001
Location: colorado, usa
Posts: 1,712
|
Hello, I was able to get everything to work as Blanius suggested but I have a problem with temps. This is because the answer is sometimes negative and I cannot get any display unless an answer is positive.
And what is the unicode for a math minus sign? I went online to look and I found 2212 as a unicode, but it still does not let me enter a minus sign. The same in Flash 8. Any ideas. This code works in flash 8 but not koolmoves. txt1.restrict = "0-9 - ."; txt2.restrict = "0-9 - ."; txt1.onChanged=function(){ //to get F if (txt1.text!=""){ t = txt1.text; b = ((5/9)*(t - 32)); txt2.text = b; } } txt2.onChanged=function(){ //to get C if(txt2.text!=""){ t = txt2.text; b = ((9/5)*t) + 32; txt1.text = b; } }
__________________
Any programming language is at its best before it is implemented and used. |
|
|
|
|
|
#14 |
|
KoolMoves Moderator
Join Date: Jul 2001
Location: Atlanta GA
Posts: 4,912
|
002D is ASCII for -
Try txt1.restrict = "0-9\u002E\u002d"; |
|
|
|
|
|
#15 | |
|
Relaxing
Join Date: Oct 2001
Location: colorado, usa
Posts: 1,712
|
Quote:
I can always omit the txt.restrict for this one particular equation, but i cannot get the answers when they are less then zero. This has me stumped. Which means its something simple.
__________________
Any programming language is at its best before it is implemented and used. |
|
|
|
|
|
|
#16 |
|
KoolMoves Moderator
Join Date: Jul 2001
Location: Atlanta GA
Posts: 4,912
|
Ok Tom You made me go look at the Flash 8 docs... LOL
txt1.restrict = " 0-9\u002E\\-"; |
|
|
|
|
|
#17 | |
|
KoolMoves Moderator
Join Date: Jul 2001
Location: Atlanta GA
Posts: 4,912
|
Quote:
|
|
|
|
|
|
|
#18 |
|
Relaxing
Join Date: Oct 2001
Location: colorado, usa
Posts: 1,712
|
Ok, this works, but with + it doesnt need the forward slash. Thank you. I did read what you had posted but ignored the slashes.
Still, why does koolmoves have this problem with getting numbers less then 0 to appear?
__________________
Any programming language is at its best before it is implemented and used. |
|
|
|
|
|
#19 | |
|
KoolMoves Moderator
Join Date: Jul 2001
Location: Atlanta GA
Posts: 4,912
|
Quote:
Like this avatar better. (yes that's me)
__________________
Bret Lanius - Film/Video/Multimedia dude Koolmoves examples and Source code - KM_Codex How to ask a question - AS3 Language Docs - Flashkit FAQ and RULES Last edited by blanius; 11-17-2006 at 11:34 PM. |
|
|
|
|
|
|
#20 | |
|
Relaxing
Join Date: Oct 2001
Location: colorado, usa
Posts: 1,712
|
Quote:
Whoops..Thats why I don't post pics of myself...nevermind Really though. Thanks for the help
__________________
Any programming language is at its best before it is implemented and used. |
|
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|