equal to and less than

Here is the scenario I have an input box (input1)
I have a button to test the input box with the following script on it:

on (release) {
      if (eval(input1 >= 1.4 and input1<= 1.5)) {
            this.right1.gotoAndPlay(2);
      } else {
            input1 = "";
            this.wrong1.gotoAndPlay(2);
      }
}

This is what I am trying to accomplish--that whatever the user inputs into the input box
has to be between 1.4 and 1.5 in order to get the question correct.

but of course my script does not work...can someone please tell me why?
frankybonesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kanaryCommented:
hello frankybones,

create an input text, give it  variable name in the Var box in its properties pannel, say"data1"

now create a button, in its action add the following:

on (release) {
    if (data1 >= 1.4 && data1<= 1.5) {
         trace("true");
    } else {
         data1 = "";
         trace("false");
    }
}

im assuming u r running flash MX, if u r running flash 5 and the above didn't work, try this:

on (release) {
    if (eval(data1) >= 1.4 && eval(data1)<= 1.5) {
         trace("true");
    } else {
         data1 = "";
         trace("false");
    }
}


hope this helps,
kanary.
rexmorCommented:
I think we need to convert to a Number(input1)...

on (release) {
      if ((Number(input1)>=1.4) and (Number(input1)<=1.5)) {
            this.right1.gotoAndPlay(2);
      } else {
            input1 = "";
            this.wrong1.gotoAndPlay(2);
      }
}



hope that helps,



rexmor

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.