Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / May 2004



Tip: Looking for answers? Try searching our database.

Remoting with ActionScriptV2

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gundja - 24 May 2004 15:11 GMT
Hi,

I am trying to do Remoting with actionscript V2.

i've got a class which is the entry point of the application like that :
class Application {
 static var globalGateway:NetConnection

public static function getGateway():NetConnection
{
 if(this.globalGateway==null)
 {
      //initialize the gateway
 }
return this.globalGateway;
}
}
whe i'am testing all is ok. So, next step, i want to invoke a .NET method an
trace the result of the method (very easy with as1.0, but here we are in v2....)

so i create a new class like :
class NewClass{
  //constructor
 function NewClass()
{
 addEventListener("load", onLoad);
}

function onLoad():Void
{
 var myConnection:NetConnection = Application.getGateway();
myConnection.getService("classpath");
myConnection.call("methodpath", this);
}
}

When i'm testing, the .NET's method is calling (good). But i don't find the
method to see the result in Flash !!?
Anyone to help me ?
when i add function onResult(result):Void, this method is never call, like
method_Result etc... I would apply the singleton pattern to my application
(next step).

Thanx
Gundja - 24 May 2004 17:02 GMT
OK i found :

        TempObject = function(obj, objParent)
        {
            myConnection = obj;
            myConnection.getService("classPath");
            myConnection.call("methodPath", this);
            this._parent = objParent;
        }   
        TempObject.prototype._parent;       
       
        /* Invoke the .NET method */
        var myConnection:NetConnection;
        myConnection = Application.getGateway();       
        var myObject = new TempObject(myConnection, this);
        myObject.onResult = function(result){_parent.handleResult(result);}

like that, i can handle the result in my parentObject and manage result with
object in my movieclip or application.

If anyone is interesting by the gobal code to add an abstract layer for the
remoting, don't hesitate to contact me !
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.