0 Replies Latest reply on Jan 23, 2007 6:31 AM by mltv

    How to refer to the calling page's assets from a class in included library.

      I have a login class that is in a library included in my project.
      The project calls the class:
      import dataManagers.LoginManager;
      public var lm:LoginManager = new LoginManager();

      Here is the class that is being called:

      package dataManagers {
      import models.users;
      import mx.rpc.events.ResultEvent;
      import flash.events.MouseEvent;
      import flash.events.Event;
      import mx.managers.PopUpManager;
      import mx.rpc.remoting.RemoteObject;
      import mx.rpc.events.FaultEvent;
      import mx.controls.Alert;
      import mx.utils.ObjectUtil;
      import flash.display.DisplayObject;
      import models.users;
      public class LoginManager {
      import LibraryViews.Login.LoginForm;
      private var appCFC:RemoteObject;
      private var loginPopUp:LoginForm;
      private var theCallingParent:DisplayObject
      public var theUserObject:users;

      private function server_fault(event:FaultEvent):void{
      Alert.show(ObjectUtil.toString(event.fault) );
      public function initServices(theParent:DisplayObject): void{
      theCallingParent = theParent;
      appCFC = new RemoteObject("ColdFusion");
      appCFC.source = "CFC.Users.usersGateway";
      appCFC.addEventListener(FaultEvent.FAULT, server_fault);
      public function init_result(event:ResultEvent):void{
      if(event.result == 0){
      private function displayLogin():void{
      loginPopUp = LoginForm(PopUpManager.createPopUp(theCallingParent,LoginForm,true));
      loginPopUp.addEventListener("loginSuccessful", removeLoginPopup);
      //Removes vendor form
      private function removeLoginPopup(event:Event):void{
      theUserObject = loginPopUp.detailLoginObject;
      public function getById_result(event:ResultEvent):void{
      if(event.result.ID != 0){
      theUserObject = event.result as users;
      }//End Class
      }//End Package

      The class then handles the entire login and has to return an object representing the user info from the database.

      The problem I am having is referring to the parent page to pass the “user Object” back.
      My work around for calling the popup by passing the Display object when I call the class does not work for passing the “User Object” back.