Well, I've just wasted THREE HOURS trying to work around a stupid stupid bug in Macromedia Flash MX Version 6. The problem was that when I used the Selection.setFocus() method, a static non-functioning caret (a ghost caret, if you like) would appear in every TextField that I had, because they were stored in a MovieClip for ease of use. Not a big thing, you may think, but this is a pretty key component to my next 4 months work, so I kinda want to get it right, and ugly vertical lines all over my text fields didn't look very good. Think I've dropped enough keywords for google?
After three hours of trawling through google and google groups with various combinations of keywords, I came across one single post from 2002 in google groups (my new favourite place in the whole wide world) which said:
I've recently had exactly the same problem.Awesome.
To fix it, I changed all of my TextField types from 'input' to 'dynamic'. That means you cannot type in them, so they cannot have the cursor any more. Cunning. However, they can have the focus, so when they get the focus, change them to an input so you can type. When they lose the focus, change it back to dynamic. If you've stumbled across this page trying to fix the same problem as me, I've recently had exactly the same problem. You may find the following code helpful:
myTextFieldName.onKillFocus = function() {
this.type = "dynamic";
}
myTextFieldName.onSetFocus = function() {
this.type = "input";
}Now leave me a comment saying you found it useful! Have a nice day :)




Comments