If I’m loading images via the <img> tag in a dynamic text field and an IOError is thrown, what would I attach the event listener too? the text field?
I tried this…
var textField:TextField = new TextField();
textField.htmlText = "here is some text <img src='image.jpg'> and then some more";
textField.addEventListener(IOErrorEvent.IOError, function (e:Event):void { trace("error caught") });
to no avail…
Suggestions?
You have to set an
idtoimgand then use it within getImageReference on yourTextFieldto get theLoaderwhere you can add all the Event you want:Another example here if you want