Post details: the coolness of tracing to a file - no more silently failing Flash apps!

04/11/04

Permalink 09:52:25 pm, Categories: Flash

the coolness of tracing to a file - no more silently failing Flash apps!

a couple of weeks ago i reported on the configuration settings to allow the debug Flash player to log trace output to a local text file. out of curiousity i opened up that log file today and saw something quite interesting - a very detailed log from whatever the last Flash movie i viewed in IE was. what was interesting was that there were all sorts of "Warning:" lines that specified that functions didn't exist or variables were not defined. i thought "wow - that movie's developer was hardcore in their tracing."

but something didn't seem right. i didn't think a developer could trap if a called function didn't exist or a variable hadn't been defined. i mean, the Flash player just fails gracefully, no? (yeah, you could probably create a very robust architecture that could handle these things, i know... but 96% of Flash coders don't, i'm sure :-)

well - i fired up MX2004 and typed in the just following code (and no other code):

_level0.onMove();
trace(y);

i compiled it without any errors, and then published and opened the HTML page in IE.  checking my log file, it contained this:

Warning: onMove is not a function
Warning: Reference to undeclared variable, 'y'
undefined

NEAT! all the things that fail silently in the player seemed to be output here. these things don't even show up in the Output Panel in Flash if you are remote debugging.

there was one other thing, then, that i wanted to test. so this time i changed my code to this (and only this):

_level0.onMove();
var Y=0;
trace(y);
trace(Y);

my flashlog.txt output after viewing this movie:

Warning: onMove is not a function
Warning: Reference to undeclared variable, 'y'
-- Probably a case mismatch.
undefined
0

HOLY CRAP! "Probably a case mismatch"!!!!!! this could be very useful for all you folks updating AS1 scripts to AS2 - especially with strict case requirements (eg: Y != y)

:-)
g.

Permalink

Comments:

No Comments for this post yet...

Comments are closed for this post.

Search

Misc

Syndicate this blog XML

What is RSS?

The opinions expressed on this blog are those of the author only and are not necessarily those of his employer.

Creative Commons License
This work is licensed under a
Creative Commons License.

powered by
b2evolution