Sample net connection and responder in AS3.  AS3 has remoting built in.

Sample


package B.As3.Game.TileEngineService
{
 import flash.net.NetConnection;    
 import flash.net.ObjectEncoding;

 public class TileEngineService extends NetConnection
 {
  function TileEngineService(url:String)
  {
   // Set AMF version - AS3 = AMF3, AMF0 is for older as2 etc.         
   objectEncoding = ObjectEncoding.AMF3;            
   // Connect to gateway            
   connect(url);        
  }
 }
}

package B.As3.Game.TileEngineService
{ 
 import flash.display.*;
 import flash.events.*;
 import flash.filters.*;
 import flash.geom.*; 
    import flash.net.*;
 import flash.utils.*;
 
 import B.As3.Util.*;  
 import B.As3.Game.TileEngine.*; // our connection to the service 
 
 public class TileEngineServiceAPI    
 {        
  // our service connector, NetConnection
  private var rs:TileEngineService;
  private const namespacePrefix:String = 
"B.Net2.Game.TileEngine.TileEngineServiceAPI.";
  
  function TileEngineServiceAPI(url:String)        
  {        
   trace(namespacePrefix + " started...");
   rs = new TileEngineService(url);
  }       
  
  public function GetTemplateItems3(str:String)
  {
   var responder:Responder = new Responder(GetTemplateItems3_onResult, 
GetTemplateItems3_onFault);            
   rs.call(namespacePrefix + "GetTemplateItems3", responder, "testing"); 
  }
  
  private function GetTemplateItems3_onResult(result:Object):void        
  {            
   
   trace("result:" +result);
   //trace("result:" +result.result);
   
   for(var items:String in result) 
   {
    trace("items" +items);
    if (typeof(result[items]) == "object") 
    {
     //mediaList.push(list[items]);
     for (var d:String in result[items]) 
     {     
      trace(d + " - " + result[items][d]);
     }
    }
   } 
  }        
        
  private function GetTemplateItems3_onFault(fault:Object):void        
  {            
   trace( fault);        
  }
 }
}



RYAN CHRISTENSEN
MCSD C#.NET | MCSD C++ | MCAD.NET | Java
Bridgeware.com | eMarketinginc.com
drawk. llc.
design and programming services
[EMAIL PROTECTED]
480.612.4957
C# | Java | PHP
MS SQL | Oracle | mySQL

  ----- Original Message ----- 
  From: Ryan Christensen [draw.logic] 
  To: Open Source Flash Mailing List 
  Sent: Wednesday, July 25, 2007 11:01 AM
  Subject: Re: [osflash] alternative to mx classes


  I would go straight to AS3 where these classes are part of flash.net 
namespace.

  http://livedocs.adobe.com/flex/2/langref/flash/net/NetConnection.html

  AS2's time is over.



  RYAN


  RYAN CHRISTENSEN
  MCSD C#.NET | MCSD C++ | MCAD.NET | Java
  Bridgeware.com | eMarketinginc.com
  drawk. llc.
  design and programming services
  [EMAIL PROTECTED]
  480.612.4957
  C# | Java | PHP
  MS SQL | Oracle | mySQL

    ----- Original Message ----- 
    From: izak marais 
    To: Open Source Flash Mailing List 
    Sent: Wednesday, July 25, 2007 6:37 AM
    Subject: Re: [osflash] alternative to mx classes


    Hi

    Wow, that looks excellent! I just started learning flash (open source from 
the start) so I've been  getting along without the mx packages, but there are 
some features here that look really useful.

    Does everyone else agree that eka's packages are the way to go?

    Izak

    eka <[EMAIL PROTECTED]> wrote: 
      Hello :)

      you can use my opensource framework and this extensions :

      http://code.google.com/p/vegas/

      To install my framework read : 
http://code.google.com/p/vegas/wiki/InstallVEGASwithSVN

      Replace for example the NetConnection class of macromedia with my 
NetServerConnection :

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

      If you want use remoting you can use my asgard.net.remoting package :

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

      etc....

      The examples are in the directory : 
http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/bin/test/ 


      EKA+ :)


      2007/7/25, distinctinteractive <[EMAIL PROTECTED]>: 
        Hi all.

        I've been developing in Flash for several years no, but have recently
        taken the plunge and started to use open source software/components as
        i've now finished university and didn't want to fork out a load of cash 
        for the Flash IDE. I am using FlashDevelop and have decided to try and
        figure out the aswing component set (although if anyone can suggest an
        alternative.....?)

        I was told recently that i will be unable to use the NetConnection 
        class(along with the other classes in the mx package) as they are tied
        to the Flash IDE licence. I had a search on OSFlash but the shear number
        of alternatives is rather baffling.

        Can anyone please suggest an alternative to these classes? 

        Thanks

        _______________________________________________
        osflash mailing list
        [email protected]
        http://osflash.org/mailman/listinfo/osflash_osflash.org


      _______________________________________________
      osflash mailing list
      [email protected]
      http://osflash.org/mailman/listinfo/osflash_osflash.org





----------------------------------------------------------------------------
    Need a vacation? Get great deals to amazing places on Yahoo! Travel. 


----------------------------------------------------------------------------


    _______________________________________________
    osflash mailing list
    [email protected]
    http://osflash.org/mailman/listinfo/osflash_osflash.org



------------------------------------------------------------------------------


  _______________________________________________
  osflash mailing list
  [email protected]
  http://osflash.org/mailman/listinfo/osflash_osflash.org
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to