The main problem is, when I type-in polish letters like: ą ę ć ż (you probably won’t see them because of your US keyboard) in the search box, the flash sends a ex. %B3 value instead of the actuall letter. First of all, Im using some AS to add the future of PL signs into my Flash (Macromedia yet again didn’t added it to the MX’04 :/) but I don’t know how to modify the script. On another forum they said that I have to use the escape(); unescape(); cmd, but I don’t know where to put it.
Here’s the flash:
http://bohner.asdf.pl/misc/flash.fla - source
http://bohner.asdf.pl/misc/flash.html - view
And here’s the AS:
var tp = TextField.prototype;
tp.fpl = new Array();
with (tp) {
fpl[65] = new Array(“Ą”, “ą”);
fpl[67] = new Array(“Ć”, “ć”);
fpl[69] = new Array(“Ę”, “ę”);
fpl[76] = new Array(“Ł”, “ł”);
fpl[78] = new Array(“Ń”, “ń”);
fpl[79] = new Array(“Ó”, “ó”);
fpl[83] = new Array(“Ś”, “ś”);
fpl[88] = new Array(“Ź”, “ź”);
fpl[90] = new Array(“Ż”, “ż”);
}
tp.onKeyDown = function() {
this.caret = Selection.getCaretIndex();
if (Key.isDown(1) {
if (!this.alt) {
this.alt = 1;
this.selectable = false;
this.type = “dynamic”;
}
}
if (this.alt) {
var k = Key.getCode();
(k == this.kll) ? this.onKeyUp() : null;
this.kll = k;
}
};
tp.onKeyUp = function() {
this.kll = null;
this.kl = Key.getCode();
if (this.kl == 1 {
this.alt = 0;
this.selectable = true;
this.type = “input”;
Selection.setFocus(this);
Selection.setSelection(this.caret, this.caret);
} else if ((this.kl == 65 || this.kl == 67 || this.kl == 88 || this.kl == 69 || this.kl == 76 || this.kl == 78 || this.kl == 79 || this.kl == 83 || this.kl == 90) && this.alt) {
(Key.isToggled(20) || Key.isDown(16)) ? this.kl=this.fpl[this.kl][0] : this.kl=this.fpl[this.kl][1];
var b = Selection.getBeginIndex();
var e = Selection.getEndIndex();
if (e>b) {
this.text = this.text.substr(0, b)+this.text.substr(e);
(this.caret == e) ? this.caret=b : null;
}
this.text = this.text.substr(0, this.caret)+this.kl+this.text.substr(this.caret++);
Selection.setSelection(this.caret, this.caret);
}
};
tp.onSetFocus = function(ss, sn) {
if (ss != sn) {
eval(ss).alt == 1 ? eval(ss).selectable=true : null;
Key.removeListener(ss);
Key.addListener(sn);
}
};
delete tp;
Selection.addListener({onSetFocus:function () {
var f = eval(Selection.getFocus());
if (f.type == ‘input’) {
Selection.addListener(f);
f.alt = 0;
f.caret = 0;
}
}});
Thx for all the help.