PDA

View Full Version : setFocus() with Components


thesquirrel
11-24-2005, 04:44 PM
Hi

Having any component in your library, plays havoc with the way setFocus() works.

For instance if I use


Selection(myText_txt)


to set the text cursor in a text field. And then click outside the textfield, it looses focus.

However, if I have a component in my library, when I click outside the textfield it doesn't loose focus.

This is having all sorts of mad knock-on effects on my project.

Does anyone know why this happens and how I can stop it?

Any help would be really appreciated, it's driving me mad.

Cheers

thesquirrel
11-24-2005, 05:40 PM
ok ... seems there is a bug ...

http://flashmx2004.com/forums/index.php?showtopic=5171&hl=setFocus

http://www.philterdesign.com/blog/archives/000031.html

whitekite
02-28-2006, 10:29 AM
By adding:

Selection.setFocus(this);

inside the on (press){ script or the ill-fuctioning button you want focus back on, the component appears to release the focus and the movie returns to normal.