开发者

How do you write and debug server side actionscript?

what is the best way to write and debug Server Side Action Script on Flash Media Se开发者_JAVA百科rver?

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.


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.


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 );
}


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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜