Hey Tucker,<br><br>The link that Raju sent does the following hack to use the Flash stack trace output to parse out a function's name in AS3 (when debugging is enabled)<br><br><pre>private function getFunctionName(e:Error):String<br>
{<br>        var s:String = e.getStackTrace();<br>        var i:int = s.indexOf("at ");<br>        var j:int = s.indexOf("()");<br>        return s.substring(i + 3, j);<br>}<br><br>private function getCallingFunctionName(e:Error):String<br>
{<br>        var s:String = e.getStackTrace();<br>        // trace(s);<br>        var i:int = s.indexOf("at ");<br>        i = s.indexOf("at ", i + 3);<br>        if (i == -1)<br>                return "caller unknown";<br>        var j:int = s.indexOf("()", i + 3);<br>
        return s.substring(i + 3, j);<br>}<br></pre>
<p>where the latter two functions are can be used like this:</p>
<pre>private function doSomething():void<br>{<br>        trace(getFunctionName(new Error()));<br>        doit();<br>}<br></pre><br><pre>private function doit():void<br>{<br>        trace(getFunctionName(new Error()));<br>        trace(" called by", getCallingFunctionName(new Error()));<br>
<br><br><br><font size="2"><span style="font-family: arial,helvetica,sans-serif;">Could we do something like this in the deprecation method (or some more general place in the debugger)</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;">to print function names more informatively?</span></font><br style="font-family: arial,helvetica,sans-serif;"><br><br></pre><br><div class="gmail_quote">On Wed, Jan 27, 2010 at 4:14 AM, Raju Bitter <span dir="ltr"><<a href="mailto:rajubitter@googlemail.com">rajubitter@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Max,<br>
<br>
what is the reason that the warning to use getDisplayObject() instead of getMCRef() is not displayed correctly in DHTML? In SWF10 runtime I get the warning<br>
<br>
INFO #helloView.Function is deprecated. Use the #helloView.Function instead<br>
<br>
In SWF8 and DHTML output is correct:<br>
INFO %cssview.lzx#32: #helloView.getMCRef is deprecated. Use #helloView.getDisplayObject instead<br>
<br>
Looking into the code <a href="http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs" target="_blank">http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs</a> I see that you just dump the function reference in the warning. I guess that's because there's no API to retrieve a function's name in AS3. There is a workaround, though, described here:<br>
<a href="http://blogs.adobe.com/aharui/2007/10/debugging_tricks.html" target="_blank">http://blogs.adobe.com/aharui/2007/10/debugging_tricks.html</a><br>
<br>
For this to work, you need to turn on the -verbose-stacktraces=true compiler option - which I'm not sure is done for OpenLaszlo.<br>
<font color="#888888"><br>
- Raju<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br><br>