Prev | Current Page 353 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

hx- > TraceHandler- > main- > line(6) : Can I trace it?
MyClass.hx- > MyClass- > someFunc- > line(50394) : let??™s find out...
MyClass.hx- > MyClass- > someFunc- > line(50394) : Yes I can!
TraceHandler.hx- > TraceHandler- > main- > line(14) : Are you sure?
TraceHandler.hx- > TraceHandler- > main- > line(14) : Just to be certain...
TraceHandler.hx- > TraceHandler- > main- > line(14) : Definitely!!!
The first part of the code to look at is the myTrace function, as it is here that most of the work is carried
out. This function is assigned as the body code for the haxe.Log.trace function, and overwrites the
original functionality. The myTrace function then facilitates the handler for the trace and haxe.Log
.trace function calls.
184
Part I: The Core Language
When trace is now called, the myTrace function first checks for the existence of a TextField object on
the Flash stage with the name __txtField__ , and creates one if it is not found. Then, it loops through
any custom parameters passed with the function call, and displays them inside the TextField .


Pages:
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365