Ok, if you're getting this from an rss feed then you're not going to like
this. Also this solution uses mx_internal. If you don't know what that is,
it's a set of methods/properties, that adobe says may change so they should
be used with extreme care because your code might break on updates.
However, in this case we're using it once to avoid creating a subclass so I
think it's a fair trade.
import mx.core.mx_internal;
use namespace mx_internal; // this line should be right after the import
statements.
...
textArea.htmlText = rssText;
textArea.validateProperties(); // initializes image loaders
var textField:UITextField = textArea.getTextField(); // mx_internal line to
get textField of TextArea
for (each imageID in rssText) { // how you actually implement this psuedo
code line depends on the rssText you already have
var loader:Loader = textField.getImageReference(imageID) as Loader;
var loaderInfo:LoaderInfo = loader.contentLoaderInfo;
if (loaderInfo.bytesLoaded != loaderInfo.bytesTotal) { // it would be
pointless to add listeners to loaders that have completed
loaderInfo.addEventListener(IOErrorEvent.IO_ERROR,
imageLoaderErrorListener); // you might want to use weakReference here for
memory management if it works.
}
}
public function imageLoaderErrorListener(event:IOErrorEvent):void {
// inform user if you want.
}
- Dan Freiman
On 10/28/07, arpan srivastava <[EMAIL PROTECTED]> wrote:
>
> Hi Dan,
>
> There is no stacktrace, this is the only thing i get.
>
> ----- Original Message ----
> From: Daniel Freiman <[EMAIL PROTECTED]>
> To: [email protected]
> Sent: Saturday, October 27, 2007 9:02:27 PM
> Subject: Re: [flexcoders] Error with htmlText property of TextArea -
> "Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an
> unknown type"?
>
> Can you post the stack trace from the error?
>
> - Dan Freiman
>
> On 10/27/07, arpan srivastava <[EMAIL PROTECTED] com
> <[EMAIL PROTECTED]>> wrote:
> >
> > Hi All,
> >
> > i am creating a rss reader for which i am using TextArea to display RSS
> > description which is simple html text. Sometimes i am getting this error:
> >
> > Error #2044: Unhandled IOErrorEvent: . text=Error #2124: Loaded file is
> > an unknown type
> >
> > I have also put a try and catch but it is not getting caught. Also,
> > TextArea does not have any IOErrorEvent event. I think it is due to
> > loading of images from "img", it comes very randomly. Can anyone help me
> > with this problem?
> >
> > --
> > Thanks,
> > Arpan
> >
> > ____________ _________ _________ _________ _________ __
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam protection around
> > http://mail. yahoo.com <http://mail.yahoo.com>
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
>