[flexcoders] Error with htmlText property of TextArea - "Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type"?

2007-10-26 Thread arpan srivastava
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 

Re: [flexcoders] Error with htmlText property of TextArea - "Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type"?

2007-10-27 Thread Daniel Freiman
Can you post the stack trace from the error?

- Dan Freiman

On 10/27/07, arpan srivastava <[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
>
>  
>


Re: [flexcoders] Error with htmlText property of TextArea - "Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type"?

2007-10-28 Thread arpan srivastava
Hi Dan,

There is no stacktrace, this is the only thing i get. 

- Original Message 
From: Daniel Freiman <[EMAIL PROTECTED]>
To: flexcoders@yahoogroups.com
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
> 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 


  


























  























__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: [flexcoders] Error with htmlText property of TextArea - "Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type"?

2007-10-28 Thread Daniel Freiman
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: flexcoders@yahoogroups.com
> 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
>
>  
>


Re: [flexcoders] Error with htmlText property of TextArea - "Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type"?

2007-10-29 Thread arpan srivastava

Thanks Dan, i am now able to get rid of this error. what i am doing is, 
when IOErrorEvent is fired i am removing the images from the htmlText and just 
displaying the text.

- Original Message 
From: Daniel Freiman <[EMAIL PROTECTED]>
To: flexcoders@yahoogroups.com
Sent: Sunday, October 28, 2007 10:39:49 PM
Subject: Re: [flexcoders] Error with htmlText property of TextArea - "Error 
#2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown 
type"?










  



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.validatePr operties( ); // initializes image loaders

var textField:UITextFie ld = textArea.getTextFie ld(); // 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.getImageR eference( imageID) as Loader;
  var loaderInfo:LoaderIn fo = 
loader.contentLoade rInfo;
  if (loaderInfo. bytesLoaded != loaderInfo.bytesTot al) {  // it would be 
pointless to add listeners to loaders that have completed
 loaderInfo.addEvent Listener( IOErrorEvent. IO_ERROR, imageLoaderErrorLis 
tener); // you might want to use weakReference here for memory management if it 
works.

   }
}

public function imageLoaderErrorLis tener(event: IOErrorEvent) :void {
   // inform user if you want.
}

- Dan Freiman


On 10/28/07, 
arpan srivastava <[EMAIL PROTECTED] com> wrote:













  




Hi Dan,

There is no stacktrace, this is the only thing i get. 


- Original Message 
From: Daniel Freiman <
[EMAIL PROTECTED] com>
To: [EMAIL PROTECTED] ups.com
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
> 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 


  


























  








 _ _ _ _ __
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

http://mail. yahoo.com 


  


























  























__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com