davey
02-02-2007, 03:15 AM
Hi everyone,
I'm currently on the hair-pulling roller-coaster journey that is putting an interactive crossword together, and for all intent and purposes it's been going pretty well so far. However, because it's a non-english crossword, I'd like to give the user an opportunity to insert special characters into a selected input field (the field that has focus). Currently I can display the instance name of the input field in a dynamic text field that is selected using:
word = eval(Selection.getFocus());
temp.text = word._name;
Which is fine, but what I'd like to be able to do is have a button that displays the desired character (e.g "Ä"), so that when the input field that needs a special character has focus, the user can click the button that corresponds to the letter and insert it.
The problem that I'm having is that I don't seem to be able to refer to the variable from inside a movie clip or a button, because something like this just returns an "undefined":
// displays instance fine
word = eval(Selection.getFocus());
temp.text = word._name;
// no luck here
clip.onRelease = function() {
temp.text = word._name;
}
So ultimately if that method actually worked, I'd have:
word = eval(Selection.getFocus());
clip.onRelease = function() {
_root.word._name.text = "Ä";
}
I've tried a few variations, including putting it inside a button, but nothing seems to work, just the continually demoralising "undefined." Can someone explain what I'm doing wrong?
Thanks all for your time
Dave
I'm currently on the hair-pulling roller-coaster journey that is putting an interactive crossword together, and for all intent and purposes it's been going pretty well so far. However, because it's a non-english crossword, I'd like to give the user an opportunity to insert special characters into a selected input field (the field that has focus). Currently I can display the instance name of the input field in a dynamic text field that is selected using:
word = eval(Selection.getFocus());
temp.text = word._name;
Which is fine, but what I'd like to be able to do is have a button that displays the desired character (e.g "Ä"), so that when the input field that needs a special character has focus, the user can click the button that corresponds to the letter and insert it.
The problem that I'm having is that I don't seem to be able to refer to the variable from inside a movie clip or a button, because something like this just returns an "undefined":
// displays instance fine
word = eval(Selection.getFocus());
temp.text = word._name;
// no luck here
clip.onRelease = function() {
temp.text = word._name;
}
So ultimately if that method actually worked, I'd have:
word = eval(Selection.getFocus());
clip.onRelease = function() {
_root.word._name.text = "Ä";
}
I've tried a few variations, including putting it inside a button, but nothing seems to work, just the continually demoralising "undefined." Can someone explain what I'm doing wrong?
Thanks all for your time
Dave