my GUESS (just a guess) is that flash reads the binary from left to right, so it ignores the 2 at the end of the statement and stops there. But if you put it at the beginning of the string, it ignores the first digit stops and does not get to read the rest and assumes it is not a number (NaN)
yeah, i agree, thats what i mean in first post.
what i think now to check whether is the number valid for its base is using substring, because i do that in java, but not sure how to do that in flash yet.
from help file, i see flash seems to has substring as well, never use it before.
What about this??? I am not sure if this is what you want, but I just made a simple example that checks the validity of the input numbers… See if this is what you are looking for… Oh, I see the same posting from AS.org… Should I call this crossposting, or not???
yeah, thats kinda what i want. but if i want say base 16, we gonna write charAt many time.
what i think is we check every word for the number and compare it to our base. the result return invalid as it meet number which is same or bigger than the base.
but i haven’t done it yet.
by the way, thanx. your replying let me learn one more new thing, charAt.:love:
Okay… 16… Hopefully this one works right… Just did fix it with ord() function to check the ASCII value…
charAt… Hehe… as long as the string itn’t too long… Know what I mean, right??? But then… I am not going to be the one who’s counting all the characters… Flash player does all the job… :evil:
thats correct, but again, if i have the base and the number for the users to input. then users can input whatever base(2-36)and number they like.
then this method become a little bit insufficient.
again thanx for replying, and let me learn one more new thing, ord.:love:
Thank you, sire… Just trying to return all the favors that I have gotton… I:-)
toh…
I am not quite getting what your just said…
if i have the base and the number for the users to input. then users can input whatever base(2-36)and number they like.
Can you repharase this??? I cannot really imagine what kind inputs you want to verify… Can you also show me the variation of possible user input??? When you said 2-36, you meant 2-16, right???
PS>> What part of ASIA are you from??? Just curious…
And… for the user to input their own things can’t you just have some kind of checkbox type thing and depending on which checkbox is checked, the code will be validated for that base by calling on a specific function.
(I really have no clue what I am talking about, just shooting ideas)
Yup… Having that kind of restriction will help to minimize the error when coding and can be more efficiently managed…
Well… Maybe you can create a generic function that gets the input string and the base to check with, but I guess I am too lazy to do that… But then, it won’t be too much of trouble to create one as long as you understand the logic behind of it, right??? (I am not trying to solve your problem here… I am trying to help you so that you can understand and learn what needs to be done…)
(I really have no clue what I am talking about, just shooting ideas)
Don’t you really have no idea why??? Because it’s almost 4AM here and we need more coffee… I:-)
Don’t drink coffee??? Good for you… Coffee doesn’t do any good anyways… But then, I can live without the sleep, but I cannot live without coffee… :bad:
Guess you are single, right??? If you have a husband/wife, he/she won’t let you do this and help you to get to sleep… But then, my wife already gave up on me… So… 8]
I have a girlfriend of 2 years, she gets mad at me when I don’t sleep, but theres nothing I can do about it, I have a sleeping disorder and am against taking medications for anything (I am totally weird if you haven’t figured out already).
There is another weird thing… I saw the thread again and there was one hour difference… It’s 4AM in VA as it is in PA, right??? and the forum said that it is 3AM… So, I had to change the GMT-5 to GMT-4… Hm… Strange… Well… Hopefully, the sun will shine again in two hours or so, and then I can go get some sleep… Well… You… Hm… you do what you gotta do…
Yeah, that happens a couple times. It used to do it to me every other week then switch back, but then it stopped. Really weird problem, but it has to do with the server since it goes by the servers GMT time. I wouldn’t worry about it