1 Reply Latest reply on Jan 27, 2007 1:23 PM by Dr._Goomba

    Access method via RemoteObject

    Dr._Goomba
      How do you access a method using RemoteObject through AS? I have tried a number of different things and keep getting "Cannot access property or method of a null object" error. It works just fine in MXML. Thanks for any help.

      Here is my code:

      [Bindable]
      public var movieCollection:ArrayCollection;
      [Bindable]
      public var currentMovieCollection:Movie;

      public function getAllMovies():void{
      var roMovieService:RemoteObject;
      roMovieService.destination = "ColdFusion";
      roMovieService.source = "cfc.MovieGateway";
      // roMovieService.getAll.arguments = args;
      roMovieService.getAll.send();
      roMovieService.addEventListener(ResultEvent.RESULT, movieHandler);
      }

      private function movieHandler(event:ResultEvent):void{
      movieCollection = new ArrayCollection(event.result as Array);
      }