[osflash] [MTASC] -trace to call the original
Juan Pablo Califano
califa010.flashcoders at gmail.com
Tue Sep 2 08:03:37 PDT 2008
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 <freewizard at gmail.com>:
>
> 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 <niels.wolf at mediacatalyst.com>
> 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" <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
> >>>
> >>
> >>
> >
> >
> > _______________________________________________
> > osflash mailing list
> > osflash at osflash.org
> > http://osflash.org/mailman/listinfo/osflash_osflash.org
> >
>
> _______________________________________________
> osflash mailing list
> osflash at osflash.org
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/osflash_osflash.org/attachments/20080902/83ff7889/attachment-0001.html
More information about the osflash
mailing list