image loaded trough htmlText
Sorry about the obscure name.
Here's the problem; let's say you got the following code and
an image named "img.png" in the same directory.
code:
import flash.text.TextField;
var t :TextField = new TextField ();
t.htmlText = "<a href=\"#\"><img src=\"img.png\" id=\"myImage\"></a>";
addChild ( t );
The textfield will automatically load in the image and embed it.
1) How can I get a reference to the image? (To be able to handle IOErrors for instance).
I checked the livedocs and came up with this (TextField - htmlTex):
Quote:
the id attribute - Specifies the name for the movie clip instance (created by Flash Player) that contains the embedded image file,
SWF file, or movie clip. This is useful if you want to control the
embedded content with ActionScript.
Sounds like exactly what I need, only thing is - how does it work? There's no documentation whatsoever.
2) The html-link placed around the image tag won't work as you might
expect. Only the border around the image is a button, the actual image
lies over the hitarea (Check out this example ). If I solve the first
problem I'll probably be able to find away around this though.
Thanks in advance