3

what is the best way to write and debug Server Side Action Script on Flash Media Server?

I use Flash Builder for syntax highlighting, but that's all.

I want to debug, make breakpoints and step-trough server application code.

Any ideas?

EDIT1: I know about administration console for viewing trace messages, but that is not real debugging for me.

mizi_sk
  • 1,007
  • 7
  • 33

3 Answers3

1

AMS (/FMS):

Client.prototype.foo = function (){
    return this;
}

Client:

netConn.call('foo', new Responder(_debug, _debug));

And breakpoint over:

function _debug(... rest):void{
}

Is as good as it gets:

  • we use the client to debug the server
  • we have to restart the server every time the main.asc file changes
  • we have to use rsync to upload the file to the remove machine if you can't get a local dev environment (which i couldn't - after a day of futile attempts and this post being 4 years old)

Seriously, it's load of fun, try it!

1

Here is a link to the Adobe developers guide:

http://www.adobe.com/livedocs/flashmediaserver/3.0/hpdocs/help.html?content=Book_Part_34_ss_asd_1.html

This includes the developers guide, language reference, some tutorials, etc... Everything you need to get started.

A hello world in server side ActionScript 3 looks like this:

application.onConnect = function( client ) {
    client.serverHelloMsg = function( helloStr ) {
        return "Hello, " + helloStr + "!";
    }
    application.acceptConnection( client );
}
Todd Moses
  • 10,969
  • 10
  • 47
  • 65
  • Thanks Todd, but I was wondering if debugging is possible. That means attaching debugger to the server process and than make some breakpoints, set watch expressions and really *debug* the Server-Side ActionScript. The only thing I can do is trace() and see in the server log file :/ – mizi_sk Dec 16 '10 at 09:54
  • You have to use trace() fro FMS but each trace result is saved to the log for viewing after the app completes. – Todd Moses Dec 16 '10 at 13:52
  • so there is no step-break debugging for Server-Side ActionScript in FMS ... :( – mizi_sk Feb 23 '11 at 08:16
1

Although I don't know of an easy way to step through code, there are some cool things you can do.

  1. Since objects in SSAS are dynamic, you can write a custom logging method that dumps variables recursively. I've found this very useful. If you print the method name and dump arguments with each call, this is as good as stepping through code.
  2. Since SSAS is interpreted, you can write a custom admin console that processes eval statements. This is useful when doing live code, or debugging code in a certain state.
Sean Fujiwara
  • 4,506
  • 22
  • 34