Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Gsbtrace - A Browser Debug Trace Window., SwishMax - Beginner - Intermediate
gsb
post May 22 2004, 07:12 PM
Post #1


Regular Dot
Group Icon
Group: *Premier*
Posts: 52
Joined: 22-May 04
From: Seattle
Member No.: 31





gsbTrace - A browser debug trace window.
Debug your SWF6 scripts in the browser.

Not many of the SWiSHmax scripts I write run in the SWiSH internal player. So I always use the "test in browser" option. And that means no internal trace() function making debugging a bit blind at times. So I developed an independent SWiSH movie to help me debug new movies - gsbTrace.

The movie, gsbTrace, is simply a scrolling text box running in it's own browser window. It uses local connections to receive data from the movie being tested and writes it to the scrolling text field. It is as simple as the internal player's trace() function, but instead of trace() you use gsbTrace().

To enable gsbTrace, the following code must be added to the movie under development.
Put it in the _root onload() section:
CODE
onload() {

// set up for gsbTrace window
outgoing = new LocalConnection();
_global.gsbTrace = function(str) {
outgoing.send( "_4gsbTraceWin", "gsbTrace", str );
};

...

}

When you are ready to test your movie, be sure to open the gsbTrace.swf first. I find it best to reduce the gsbTrace window size and push it to one side. Then, run your test movie from in SWiSH File/Test/In Browser (or the exported HTML) again resizing/repositioning the window to allow viewing both movies simultaneously. You can even upload your movie and test it from your web site.

Here is an example. First, open the gsbTrace window here: gsbTrace.swf
Remember to reduce it and move it aside. Then open the this test movie and text in browser: Movie1.html
(Note: The test movie is blank. Watch the gsbTrace window.)

This is the test movie's script so you can see how the trace is generated.
CODE
onload () {
// set up for gsbTrace window
outgoing = new LocalConnection();
_global.gsbTrace = function(str) {
outgoing.send( "_4gsbTraceWin", "gsbTrace", str );
};
gsbTrace("movie loading... " add Timer.ticks() );
onEnterFrame=function() {
if(++count>=110) delete onEnterFrame;
gsbTrace(">> "+count+" ?"+Timer.ticks());
};
}

Not much to this simple test example, but with more complicated movies it can save hours of development time.

HOW TO:
- To toggle the scroll from auto to manual simply click on the text field anywhere.
- Use the browser window 'refresh' button to clear the text field.
- Resize as needed and the scrolling text field will adjust.

HINT: Create a new .swf file with just the gsbTrace code from above and save it as a template.
Then use FILE/New From Template to start new projects.

NOTE: Following testing and before you finally publish your movie for real, you should comment out all of the gsbTrace code/statements.

Project zip file attached: (7k)
- gsbTrace.swi
- gsbTrace.swf
- Movie1.swf
- Movie1.swi
Attached File(s)
Attached File  gsbTrace.zip ( 6.82K ) Number of downloads: 1267
 
 
+Quote Post  Go to the top of the page
axivelet
post Mar 23 2008, 06:47 PM
Post #2


Getting Used To The Dots
Group Icon
Group: Member
Posts: 45
Joined: 19-March 08
Member No.: 19,875





thank you
 
+Quote Post  Go to the top of the page

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 29th July 2010 - 10:51 PM
Computer Jobs | Home Insurance | Property in Spain | Computer Jobs | Life Insurance