+1  A: 

you can't! there is no such easy way like that even in other language either than AS3 except they use AOP approach to do that.

The best practice is just let you classes bubble the Error (Exception) and let the higher layer catch and process the error.

EDIT - regarding coment

Actually the idea is the natural way.. still you need to manually catch every possible error. i'll give you example. Note that the purpose of the example only for clarity between lower layer and higher layer.

for example you have a class in the mid layer (Your Business Process):

public class MyBussiness {
    public function loadImages(){
        //for example here is a block of method
        //possibly throws exception. 
    }

    public function getLoan(){
        //lets assume here too
    }
}

in the higer layer (I Assume in your View - MXML) you catch the exception like bellow:

var myBussiness:MyBussiness = new MyBussiness():
try {
    myBussiness.loadImages();
    //any other sequence process
    myBussiness.getLoan();
}
catch(error:Error){
    //here you process error
    //show it to user or make LOG
}

still it can't do a magic like you expect but it is the best practice. Rember only put try catch only on code that has possibility to throw error because try catch is expensive.

ktutnik
Or let the higher layer ignore it, too, right? Flash won't display errors if not in debug mode, right?
Yar
ktutnik, it would be so kind if you can show me small ex to do like that. How can i catch error by higher layer class, which includes myClass.as?!
Almas Adilbek
Thanks, ktutnik. This is the way i'll implement the catch errors issue. good luck
Almas Adilbek
+1  A: 

I agree with ktutnik the best way is using try catch

try{ //your command } catch(e:Error){ //your command }

Gus Leo