Stuff I am building:


Ted Patrick - Events & Community @ Adobe Systems


Note: This is the personal blog of Ted Patrick. The opinions and statements voiced here are my own.



ASR & Server-Side ActonScript

DIGG IT!     0 Comments Published Friday, July 04, 2003 at 5:53 AM .

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

0 Responses to “ASR & Server-Side ActonScript”

Post a Comment

Where to find me:

Ted on Twitter - @AdobeTed
Ted on Adobe Groups
Ted on LinkedIn
Ted on Facebook
Ted at Adobe


Latest

Lists

Links

Jobs

Flex Jobs
city, state, zip

Archives