Cross check 2 input boxs

Posted on 2005-03-23
Medium Priority
Last Modified: 2008-02-07
I have two input boxes on a frame, one called Rand and the other called Guess. Both contain a six digit number. What I want to do is cross check the two input boxes to see how many digits are the same in the two boxs. If all are correct I want an output of 6 and if 2 are the same i want an output of 2 etc.

Here is the code i have so far but it is not working.

var Rand:String = "";
var Guess:String = "";
counter = 0;
for (i=0; i<Rand.length; i++) {
     if (Guess.charAt(i) == Rand.charAt(i)) {
Question by:lukegriffiths110
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 18

Expert Comment

ID: 13612980
You need to have a value in your string. You get this from your textfields, using the variable names you gave them.

Rand1= String(Rand); //where rand1 is the variable name of your generated text field

LVL 18

Accepted Solution

Billystyx earned 2000 total points
ID: 13613002
and Guess1=String(Guess);

where Guess is the variable name of you rinput field (and in previous post Rand is the name of the variable in the generated text field for the lottery number)


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question