|
var i = 0; var count = 0; _root.onEnterFrame = function() { count++; count %= 5; if (count == 0) { _root.createTextField("txt"+i, i, 25+500*Math.random(), 0, 12, 12); with (_root["txt"+i]) { text = String.fromCharCode(Math.floor(26*Math.random())+65); autoSize = "center"; type = "dynamic"; textColor = 0x0000FF; border = true; borderColor = 0x999999; background = true; backgroundColor = 0xDDDDDD; } i++; } for (var j in _root) { _root[j]._y += 5; if (_root[j]._y>400) { _root[j].removeTextField(); } } }; _root.onKeyDown = function() { for (var j in _root) { if (_root[j].text == String.fromCharCode(Key.getCode())) { _root[j].text = "GOOD"; _root[j].textColor = 0xFF0000; _root[j].borderColor = 0xFF0000; _root[j].backgroundColor = 0xFFFF00; break; } } }; Key.addListener(_root); |