Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flex > Flex 2, 3 & 4

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-12-2009, 10:32 AM   #1
windec
Registered User
 
Join Date: Feb 2009
Posts: 3
Default catching and displaying errors?

A component connects to the server and does stuff if the server is down the flash debug player shows ioerror. I try various methods in the mx:script area and in the first method flex says err cannot be found and in the second method compoent_name cannot be found. It is a pure procedural code and there are no classes whatsover. Anybody knows what is wrong here?
ActionScript Code:
var err:IOError;             var err_msg:String=err.toString();             //err_msg=err.toString();             if(err.message.length>0){                 labelmessage1.text= "error has occured";                             }
2nd method:
ActionScript Code:
try {                   compoent_name.source="http://server...";                               } catch (err:IOError) {                                     labelmessage1.text= "error has occured try again";             }
windec is offline   Reply With Quote
Old 06-13-2009, 03:15 AM   #2
mattb
Senior Member
 
Join Date: Nov 2007
Posts: 153
Default

Is this a Flex component, or a custom component you have written?

Generally your component will need to catch the IOError at the point in code it ocurs and rethrow a new error so that you can pick it up from your code.
__________________
Matthew Butt
http://blog.preinvent.com
mattb is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:47 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.