[haXe] trace not working for me
Roberto Saccon
rsaccon at gmail.com
Thu Jan 4 00:45:57 CET 2007
Ok, sorry for the mistake, I only realized afterwords when I took a look at
my implemntation, but you got it working ...
On 1/3/07, Hertzel Armengol <hertzel at osc.co.cr> wrote:
>
> Roberto Saccon wrote:
>
> sure, just create a class with something like this:
>
>
> class FirebugTrace{
> public static function enable() {
> haxe.Log.trace = log;
> }
>
> private static function log(arg : String)
> {
> var out = "javascript:console.log('FLASH: " + arg + "');";
> flash.Lib.getURL(out);
> }
> }
>
>
> then enable() it, and just continue to use trace as usual, it will output
> into the firebug console.
>
> regards
> Roberto
>
>
> On 1/3/07, Hertzel Armengol <hertzel at osc.co.cr> wrote:
> >
> > maumac wrote:
> > > Would you bother showing your test class?
> > >
> > > Maurício Machado
> > >
> > > On 1/3/07, Hertzel Armengol <hertzel at osc.co.cr> wrote:
> > >> hi :)
> > >>
> > >> I'm playing a bit with haxe but there's something that is not working
> > >> for me and is the famous trace!! (haxe trace)
> > >>
> > >> if I write this
> > >>
> > >> trace ("test");
> > >>
> > >> anywhere in my program and compile the file
> > >> using this xhml
> > >>
> > >> -swf test.swf
> > >> -main Test
> > >>
> > >> the resulting flash don't show anything... what can I do to see the
> > >> traces within my browser (IE, firefox)
> > >>
> > >> tnks
> > >>
> > >> --
> > >> haXe - an open source web programming language
> > >> http://haxe.org
> > >>
> > >
> > sure
> >
> > class Test {
> >
> > static function main () {
> > trace ("test");
> > }
> >
> > }
> >
> > > If you are running firefox and firebug, then probably the nicest
> > > thing is to rewrite trace so it uses flash.Lib.getURL and console.log
> > > from firebug, then you get all you trace statements on the firebug
> > > console.
> > >
> > > regards
> > > Roberto
> >
> > How can I do that do you have an example? that will help me a lot :)
> >
> >
> > --
> > haXe - an open source web programming language
> > http://haxe.org
> >
>
>
>
> --
> Roberto Saccon
>
> tnks men U rock!!
> but the example didnt worked for me at first so I was forced to check the
> existing haxe trace documentation (once again) and changed your code just a
> bit.... this is it
>
> class FirebugTrace{
>
> public function new() {
> haxe.Log.trace = log;
> }
>
> private static function log(v : Dynamic, ?inf : haxe.PosInfos)
> {
> var out = "javascript:console.log('FLASH: " + v + "');";
> flash.Lib.getURL(out);
> }
> }
>
>
> class Test {
>
> static function main() {
> var enableit = new FirebugTrace();
> trace("prueba");
> }
>
> }
>
> you can see that example here...
> http://h.animenakama.com/galeria/main.php?g2_itemId=101
>
> tnks again and you saved me a lot of time ^________^
>
> --
> haXe - an open source web programming language
> http://haxe.org
>
>
--
Roberto Saccon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/haxe/attachments/20070103/16b04123/attachment.htm
More information about the Haxe
mailing list