Flash bug: img in textField not linking

Yesterday I spotted what seemed to be a minor issue with having a linked image in a dynamic textField. That minor issue has turned into a massive headache.

Basically, this doesn’t work as expected:


myField.htmlText = "<a href=\"http://www.google.com\"><img src=\"image1.jpg\" /></a>";

You get the hand cursor when you mouse over the image, but clicking does nothing, unless you inadvertantly click an invisible 1px border around the image. I’ve searched here on Kirupa, Flashkit and StackOverflow and found threads of this issue going back to Flash 8 in 2007(!). It’s also been reported as a Flash bug

I’ve tried:
[LIST]
[]Loading an external image ()
[
]Loading a bitmap in the library (img src=“myImage” />)
[]Loading a movieclip from the libary (img src=“myMC” />)
[
]Using textField.getImageReference:
[/LIST]


myField.htmlText = "<a href=\"http://www.google.com\"><img src=\"image1.jpg\" id=\"myImage\" /></a>";
 
var imageButton:DisplayObject = myField.getImageReference("myImage");
imageButton.buttonMode = true;

But absolutely nothing works. All of the data being loaded is from a database, and I’ve got a couple of lengthy methods in mind that I could use to dynamically attach movieclips with link references, but it involves edits to MySQL, the XML output and a couple of PHP files, as well as the AS.

So I was wondering if anyone had an actual fix for this? It’s driving me mental.

UPDATE: After a creating a new test file from scratch, it seems that the real culprit is when you embed a font into the textfield. I initially tested a new textfield with absolutely no formatting and the linked image worked perfectly. As soon as I added a font to the library and embedded that into my textfield, the link stopped working.