Hi,
Hers a wacky way of doing it with keeping to your set up !!!PHP Code:input.restrict = "0-9";
input.maxChars = 3;
var ziro = 0;
var TheText = "000";
total.text = TheText;
input.text = TheText;
goto_btn.onPress = function()
{
setVerse = input.text;
if (setVerse.length < 3)
{
trace("add another number");
}
if (setVerse > 111)
{
total.text = TheText;
input.text = TheText;
setVerse = ziro;
}
else
{
if (setVerse > 99)
{
setVerse = setVerse;
trace(setVerse);
ShowResult();
}
if (setVerse > 9 && setVerse < 100)
{
setVerse = setVerse.substring(1, input.text.length);
trace(setVerse);
ShowResult();
}
if (setVerse < 10)
{
setVerse = setVerse.substring(2, input.text.length);
trace(setVerse);
ShowResult();
}
}
};
function ShowResult()
{
Mult = setVerse * 2;
trace(Mult);
if (Mult > 99)
{
total.text = Mult;
}
if (Mult > 9 && Mult < 100)
{
total.text = "0" + Mult;
}
if (Mult < 9)
{
total.text = "00" + Mult;
}
}




Reply With Quote