PDA

View Full Version : text input focus


country_gail
07-17-2007, 06:16 PM
I'm trying to randomize the way items come off an dataset. I am very close but having trouble with the focus of a text input box. I'm able to change it by typing in the box and then losing focus, but i can't get it to lose it by itself.

quizXML.trigger();
import mx.data.components.datasetclasses.DataSetIterator;
import mx.data.to.ValueListIterator;

function sortRand() {
if (random(2) == 0) {
return -1;
}
if (random(2) == 0) {
return 1;
}
}
questionArray = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29];
questionArray.sort(sortRand);
startNumber = 0;
changeTIButton.label = "Change Question TI";
changeTIButton.onPress = function() {
dhText.text = questionArray[startNumber];
if (startNumber == 3) {
startNumber = 0;
} else {
startNumber = startNumber+1;
}
};
nextButton.label = "Next Question";
nextButton.onPress = function() {
quizDS.next();
}

I've inserted an swf example to show what I mean. It should be a pretty easy fix for someone that's good at this.

Thanks!

country_gail
07-18-2007, 09:27 PM
It seems like it should be just one line or 2 of code strategically placed. I tried focusIn and focusOut and they didn't work for me as their examples showed but maybe they weren't placed correctly.

Please help. Pretty please with cream and sugar?

Thanks.