0 Replies Latest reply on May 27, 2011 12:20 PM by LimpingTwerp1

    Implementing a remote Object in a custom AS-Class

    LimpingTwerp1

      Heres the code:

       


         
      public function Schem()
         
      {
         
      }

         
      public function loadCurrentSchem():void
         
      {
             
      var ro:RemoteObject = new RemoteObject("Hibernatetest");
              ro
      .endpoint = "http://Jesus/blazeds/messagebroker/amf";
              ro
      .addEventListener(ResultEvent.RESULT,onResult);
              ro
      .getCells();
              info
      = info + "Loader called ... \n";




         
      }

         
      public function onResult(event:ResultEvent):void
         
      {
             
      var array:ArrayCollection = event.result as ArrayCollection;
              info
      = info + "Schemlength = " + String(array.length)+ "\n";
         
      }


         
      private function onFault(event:FaultEvent):void
         
      {
              info
      = info + "Errorhandler Called";
         
      }
         
      //Eventhandlers


         
      //Getters, Setters
      }

      Heres the code: And the mxml

       

      <fx:Script>
          <![CDATA[
              import argoseye.main.Golem;
              import argoseye.main.Schem;

              import mx.collections.ArrayCollection;
              import mx.rpc.AsyncToken;
              import mx.rpc.Responder;
              import mx.rpc.events.FaultEvent;
              import mx.rpc.events.ResultEvent;
              import mx.rpc.remoting.RemoteObject;

              protected function button1_clickHandler(event:MouseEvent):void
              {
                  var schem:Schem = new Schem();
                  schem.loadCurrentSchem();
                  textfeld.text = schem.info;
              }

          ]]>
      </fx:Script>


      So. The Class doesnt reach the eventHanlder. Why? When i do this in an ordinary mxml script tag, all works perfectly. What am i doing wrong?

       

      Greets, Twerp