I'm afraid it's not going to work, since trace is not a regular function; it
gets compiled down to its own bytecode in the swf as oposed to a normal
function call.
However, you can switch between regular trace and a custom function with
using the MSTAC switch, or (more tedious...) manually replace al trace calls
to some function you define, wich could then call the native trace and
possibly another trace function you are using.
Cheers
Juan Pablo Califano
2008/9/2, Du Song <[EMAIL PROTECTED]>:
>
> Thank you, Niels!
> It's a nice way to hijack this call.
>
> Regards,
> Du Song
>
>
>
> On Tue, Sep 2, 2008 at 17:48, Niels Wolf <[EMAIL PROTECTED]>
> wrote:
> > 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" <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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
> >>> [email protected]
> >>> http://osflash.org/mailman/listinfo/osflash_osflash.org
> >>>
> >>
> >>
> >
> >
> > _______________________________________________
> > osflash mailing list
> > [email protected]
> > http://osflash.org/mailman/listinfo/osflash_osflash.org
> >
>
> _______________________________________________
> osflash mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org