1

i've been developing on actionscript for years and i appreciate its evolution as it comes more and more a general development "language".still one thing that i noticed on both actionscript and javascript is what one can call "silent errors".i hope i will find the words to explain that: sometimes you write some lines of code ,compile the text without warning(no errors...) from the compiler(i'm using adobe Flex Builder) but when it comes to seeing the result(at run time), on the browser the result is different from what you expected...reason:at some point and for some reason, actionscript chose to ignore some lines of code without even warning! i tried to use the "try/catch" bloc but the result is still the same...

the only mean to check the point at which the compiler began to ignore the code is to use "Alert.show()" for "flex" and "alert()" for "javascript" .i mean,when there is no further more "aler()" i know that the code was ignored...often,i try to choose more "robust" expressions to avoid such behavior and the result is what is expected...In general,when some line of code is ignored,all the following lines are ignored...

may be that is a matter of undefined object calls that the compiler can not handle a runtime but if it's so ,someone have to check the compiler for this...i added the "-strict=true" to the compiler options but nothing changed...i experienced this behavior on javascript,so i guess that 's a more generalized thing...can someone explain this behavior ?

jihed gasmi
  • 279
  • 4
  • 9

1 Answers1

0

The error happen at runtime so the compiler can't warn you,what you need to do is to get the stack trace of the error and fix it, to get detailed stack trace you must run in debug mode. Also read How to catch all exceptions in Flex? you can catch the uncaught erroes there and maybe write them to a log that users can send you. The fix is to use try/catch/finaly or fix the problem(if the instance is null)

Community
  • 1
  • 1
simion314
  • 1,394
  • 16
  • 29