Showing posts with label flash. Show all posts
Showing posts with label flash. Show all posts

Thursday, July 26, 2007

alternative to mx classes

found in osflash mailing list


The AS3 version of the remoting class in VEGAS :

http://svn1.cvsdude.com/osflash/vegas/AS3/trunk/src/asgard/net/remoting/

With an example :

package
{

import asgard.events.ActionEvent ;
import asgard.events.RemotingEvent ;

import asgard.net.remoting.RemotingService;
import asgard.net.remoting.RemotingAuthentification;

import flash.display.Sprite ;

import test.User ;

public class TestAsgardRemoting extends Sprite
{

// ----o Constructor

public function TestAsgardRemoting()
{

// ----o Register your shared Class.

User.register() ;

// ----o Create Service

var service:RemotingService = new RemotingService() ;

service.addEventListener(RemotingEvent.ERROR, onError) ;
service.addEventListener(RemotingEvent.FAULT, onFault) ;
service.addEventListener(ActionEvent.FINISH, onFinish) ;
service.addEventListener(RemotingEvent.RESULT, onResult) ;
service.addEventListener(ActionEvent.START, onStart) ;
service.addEventListener(RemotingEvent.TIMEOUT, onTimeOut) ;

service.gatewayUrl = "http://localhost/work/vegas/php/gateway.php" ;
service.serviceName = "Test" ;
service.methodName = "getUser" ;
service.params = ["eka", 29, "http://www.ekameleon.net"] ;

// ----o Launch Service

service.trigger() ;

}

// ----o Public Methods

public function onError(e:RemotingEvent):void
{
trace("> " + e.type + " : " + e.code) ;
}

public function onFinish(e:ActionEvent):void
{
trace("> " + e.type) ;
}

public function onFault(e:RemotingEvent):void
{
trace("> " + e.type + " : " + e.getCode() + " :: " + e.getDescription()) ;
}

public function onProgress(e:ActionEvent):void
{
trace("> " + e.type ) ;
}

public function onResult( e:RemotingEvent ):void
{
trace("-----------") ;
trace("> result : " + e.result) ;
trace("-----------") ;
}

public function onStart(e:ActionEvent):void
{
trace("> " + e.type ) ;
}

public function onTimeOut(e:RemotingEvent):void
{
trace("> " + e.type ) ;
}


}
}
More information about this example in my blog in french about the
difference between the classmapping in AS3 and AS2 tutorial :

http://www.ekameleon.net/blog/index.php?2006/08/28/48--amf-class-mapping-difficile-en-as3

Friday, July 6, 2007

Xray AS2 Logger, mtasc utilities and samples

just saw it on osflash list by John Grden
== quote ==
I should have done this a while ago :) But some other projects have been
monopolizing my attention span!!

At the request of someone recently, I went in to see about extracting the
logger to work on it's own. I should say, I had this nagging feeling that
I'd already done this. Come to find out, I actually HAD done this a while
back. Probably when I was trying to get Xray working with zeroi.

So, I took some time and created samples last night, created a new connector
swf with 1.6.3 and made a very nice new download.

http://code.google.com/p/osflash-xray/downloads/detail?name=XrayLoggerOnly_MtascUtilities_v1.6.3.zip&can=2&q=

Samples:
FLA Logger Only: shows you how to use the logger in an FLA without the
component
mtasc logger only: shows you how to use the logger classes (no connector
loading)
mtasc load connector: a fresh demo on loading an external swf connector
with mtasc as the compiler

a copy of the 1.6.3 SWF connector is also included in the zip.

Also, I've moved Xray over to google code and you can sync up over there.
The as2 and as3 code are out there including the Flex2 UI. The as2 samples
are in the samples directory and will be updated as we go along and any
fixes/new demos come in. The AS3 logger works just fine but the xray
connector for AS3 is a really basic/barely working version - I woudn't
suggest using it right now. if you do, don't ask me questions about it ;)
It'll be a total rewrite and this was mainly experimental. The logger API
should stay the same.

http://osflash-xray.googlecode.com/svn/trunk/