| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Jun 2007
Posts: 3
|
Hi I was wondering if there was a bit of code that had the same effect as pressing the 'omit trace action' button in the publish menu.
What I'm looking to do is allow trace actions when the swf is published on one domain (used for testing) but omit them when it goes to the live server. As I don't want to recompile after testing I was hoping someone knew of a trace on/off command that can be added to the AS. Cheers Matt |
|
|
|
|
|
#2 |
|
Super Moderator
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
|
Howdy and Welcome...
![]() The output from the trace() function is visible only within the Flash IDE... and there is no ActionScript that you can use to turn on/off the output... Maybe I am missing what you are asking???
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer http://CyanBlue.FlashVacuum.com http://www.FlashVacuum.com http://tutorials.FlashVacuum.com Do NOT PM, Email or Call me... Your question belongs right in this forum...
|
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Jun 2007
Posts: 3
|
Using flash player 9 debug you can see all the trace actions from any flash movie that's on the web. I want to see these on my test domain but don't want them visible to the general public when the swf goes live.
Cheers Matt |
|
|
|
|
|
#4 |
|
Super Moderator
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
|
Well... That's out of my league cuz I have not tried CS yet... Let me move the question to the right forum for you...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer http://CyanBlue.FlashVacuum.com http://www.FlashVacuum.com http://tutorials.FlashVacuum.com Do NOT PM, Email or Call me... Your question belongs right in this forum...
|
|
|
|
|
|
#5 |
|
Flash Adventurer
Join Date: Mar 2005
Location: Silicon Valley
Posts: 1,975
|
There is no way to do this via ActionScript. You must recompile your SWF.
|
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Jan 2006
Posts: 104
|
I always put a testing variable in my code, then an if statement that says if testing == 1 allow trace calls... This has to be done for every trace call in your code. I am sure there is a better work around, but it works very well for me. I have been doing this ever since I saw a plugin for firefox that could supposedly read the trace calls, though I don't remember what it was called. That could potentially be a huge security risk for many websites that I work on, this is my fix.
Once again: ActionScript Code:
Last edited by kdittyr; 06-19-2007 at 07:24 PM.. |
|
|
|
|
|
#7 | |
|
Flash Adventurer
Join Date: Mar 2005
Location: Silicon Valley
Posts: 1,975
|
Quote:
|
|
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Jan 2006
Posts: 104
|
That's the one, thanks
![]() |
|
|
|
|
|
#9 |
|
AVM2 has mood swings. :(
Join Date: May 2007
Posts: 226
|
To be honest, I think you are going about this the wrong way.
I use a Console class that lets me add, trace, store and manipulate my development output. Here is a small chunk of it that is pertinent here: ActionScript Code:
Note that as the traces are stored in an array, they can be used again, or traced "internally" using an in-application TextField. Further, Cnsl.t() can be accessed by the user if need be, thereby allowing for console input mid application. Why the vry shrthnd? I use the class a lot, and so it is lame to have to write Console.addTracedVariableValueInHere(), rather than Cnsl.t() ![]() Finally, you will note that if I want to turn off tracing, I can simply by calling Csnl.isTracing = false. Easy easy. Hope that helps. Last edited by plutocrat; 06-19-2007 at 11:05 PM.. |
|
|
|
|
|
#10 |
|
Registered User
Join Date: Jun 2007
Posts: 3
|
I ended up adapting the bit-101 debug class to simply trace rather than send the messages to his console
http://www.bit-101.com/blog/?p=642 I now have a neat little class called 'de' so to trace I just type de.bug('arg') and I get arg= arg (saves on a bit of typing) I've hooked this in to a _global variable that looks for certain key words, such as 'offline' or the test server domain. So I now can trace in my test environments and it shuts down when live. Thanks for everyone's suggestions |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A specific map zoom out boundary Q | DoubleE | ActionScript 1.0 (and below) | 2 | 01-17-2007 01:53 PM |
| Capturing trace() actions into a variable | mikiti | ActionScript 2.0 | 0 | 01-25-2006 04:42 PM |
| Round Class (ActionScript 2.0) | Madokan | ActionScript 2.0 | 4 | 09-02-2005 11:57 AM |
| Don't do this - Code in Trace Actions | AdamSchroeder | ActionScript 2.0 | 1 | 01-20-2005 04:16 PM |
| omit trace actions by as | buggedcom | ActionScript 1.0 (and below) | 1 | 06-16-2003 02:27 PM |