Peter,
"Perhaps you saw flash.utils.trace() used in an out-dated example?"

When I type "flash.utils.t" > trace(rest:Array):void < is displayed. So, I
assumed it was still defined there but just included/imported by default.

So, is there a way to specify that I want the "global" trace function rather
than my class-defined trace function (from within my class)?


Sascha,
"Why would it be dumb to use trace?"

It's not. I use it all the time. Please take another read of my issue. I
want to use trace from within a function that was named trace.

Having the function named trace is not something I can alter, since it's
part of an API that is used by MANY people. This wouldn't be an issue except
that I just wanted to test something in my trace function ... by using trace
:)

Because of scoping rules, issuing a trace command from within a class that
has defined a function named trace results in the class-defined trace
function being called. I thought by specifying the full path to the trace
function I could get around this. However, since trace is global, and,
apparently, not part of flash.utils anymore (not sure why it gets displayed
for me though) I might not have a way to call the global trace directly.

Too bad there's no _global anymore ... ;)


On 1/2/07, Peter Farland <[EMAIL PROTECTED]> wrote:

   Derek, during very early FP9/Flex 2 beta releases the trace() method
was in flash.utils, but it was promptly moved back to the Top Level or
"global" scope after user feedback showed that importing flash.utils to
use trace() wasn't desirable.

See:

http://livedocs.macromedia.com/flex/2/langref/package.html#trace()

Perhaps you saw flash.utils.trace() used in an out-dated example?


 ------------------------------
*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
Behalf Of *Sascha
*Sent:* Tuesday, January 02, 2007 11:28 AM
*To:* flexcoders@yahoogroups.com
*Subject:* RE: [flexcoders] Call to a possibly undefined method trace

  Why would it be dumb to use trace? It's a neat way of doing a quick
debug. The debugger is not always the best choice.

Not sure why the trace will not work when called with the whole package
name, probably because it's build in globally.

Why not just simply use trace()?

Sascha

  ------------------------------

*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
Behalf Of *Derek Vadneau
*Sent:* Wednesday, 03 January, 2007 01:07
*To:* flexcoders@yahoogroups.com
*Subject:* [flexcoders] Call to a possibly undefined method trace

  I have a class that has a method called trace. I wanted to test that
method so I used trace ... I know, dumb. Anyhow, I tried using
flash.utils.trace(message) to specify the trace I wanted to execute.
That gives me a compile error: Call to a possibly undefined method
trace.

Perhaps this is academic since I can get around the issue by calling
another class' method or using a textfield, etc., but just so that
it's clear, why can't I target flash.utils.trace?

--

Derek Vadneau




--

Derek Vadneau

Reply via email to