I am in the midst of my first project that requires Flash Remoting, so I took a deep look into Server-Side Actionscript. I have to say that I am impressed.
Although you first seem constrained by the Rhino Engine, it turns out that 100% of Java is accessible within the implementation and all via a simple JavaScript wrapper. There are some quirks regarding handling of datatypes as each instance is an instance of a Java Class.
Here is a sample:
Say you pass an ASR an Object via Remoting with a nested 'name' value. To get 'name' from the Object you must use Java Object Methods:
function getSession(o){
//return the name value of the object passed
return o.get('name')
}
You can also create files and directories!!!
function createFile(pathname,data){
fo = java.io.File(pathname)
fo.createNewFile()
fw = java.io.FileWriter(fo)
fw.write(data)
}
function createDirectory(pathname){
fo = java.io.File(pathname)
fo.mkdir()
}
Much easier than using JSP or CF!
Just remember everything is a java class! http://java.sun.com/j2se/1.3/docs/api/
Cheers,
Ted ;)
DIGG IT! 
0 Responses to “ ASR & Server-Side ActonScript ”
Post a Comment