[osflash] [MTASC] -trace to call the original

Niels Wolf niels.wolf at mediacatalyst.com
Tue Sep 2 02:48:34 PDT 2008


I havent tested it now, but from what I remember of as2, is that you can
overload trace:

$trace = trace;

function trace(message:String,useOldTrace:Boolean):Void{
    if(useOldTrace)
        $trace(message);
    else
        myTraceAlternative.log(message);
}

I forgot where functions live in AS2, I dont think it was the _global
namespace.. But where ever trace is defined you might want to overload it..
So if it would be _global.trace (theoretically speaking), you would want to
do 

_global.$trace = _global.trace;
_global.trace = myOverloadFunk;


On 9/2/08 10:15 AM, "Juan Delgado" <zzzarate at gmail.com> wrote:

> I don't think you can call both because MTASC does search&replace, you
> will end up with recursive calls. So, either regular or custom trace.
> 
> I think!
> 
> Juan
> 
> On Tue, Sep 2, 2008 at 7:04 AM, Du Song <freewizard at gmail.com> wrote:
>> Hi, all
>> if i use -trace MyClass.myTrace when compiling, how to call the
>> original trace() to output to flash log file?
>> 
>> Regards,
>> Du Song
>> 
>> _______________________________________________
>> osflash mailing list
>> osflash at osflash.org
>> http://osflash.org/mailman/listinfo/osflash_osflash.org
>> 
> 
> 




More information about the osflash mailing list