ERRO TitleWindow --> call method MDIWindow

eduardo12fox
eduardo12fox used Ask the Experts™
on
Hello,

I have a problem with a window made with MDIWindow i call a funciton in that window that opens a TitleWindow this way:

var popup_Ed: PAINEL_BAIXA PAINEL_BAIXA = new ();
popup_Ed.Id_doc = GRID_APAGAR.selectedItem.Id;
PopUpManager.addPopUp (popup_Ed, this, true);
PopUpManager.centerPopUp (popup_Ed);

Ai titleWindows this opens the window I have a funcition that needs to access a function that is in MDIWindow but whenever I try to give error null. I'm trying like this:

(parent as CONTAS_A_PAGAR).LimpaGrid();
parentDocument.LimpaGrid();

HELP
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011

Commented:
I have two questions:
1) what is MDIWindow? I don't know any standard Adobe components with this name.
2) What this constractor should do and why you are not gettings errors?

var popup_Ed: PAINEL_BAIXA PAINEL_BAIXA = new ();

Author

Commented:
I recreated my environment to demonstrate the error please visit this link:
http://www.techall.com.br/expertexchange/teste.html

see that when I try to access a property of the father by the son of null error

please help me.
Top Expert 2011

Commented:
You have to use parentDocument instead parent

private function Abrir():void{
    (parentDocument as teste).OpenJanela();
}

The parent instance is SystemManager class not "teste" class
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
It did not work! He opens the same TitleWindow and I want to open the Alert which is the parent Apps

public function AbraAlert():void{
            
                  Alert.show("CHEGOU");
            
            }
Top Expert 2011

Commented:
what are you expecting why didn't work.

I am running your code and i ca open same window again and again without error

that was your prblem

Author

Commented:
Friend would like first to thank your help. I updated you on the internet to see what is wrong. I do not want to open the same window I open the ALERT is the main application that I want from within the TitleWindow Alert me to open the application that is called TitleWindow.

example:

Apps ---> Call ---> Janela2

step 2

Janela2---> Call ---> Public AbraAlert function ():void{  Alert.show("CHEGOU");  }

Author

Commented:
To explain very detailed, I do not want to open the same window when I click on the TitleWindows AbraAlert I open the function that is called in the application TitleWindow.
Top Expert 2011
Commented:
Man are u kidding, why you just didn't replace calling function?

private function Abrir():void{
   (parentDocument as teste).AbraAlert();                  
}

Author

Commented:
Yes thanks dgofman

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial