• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 331
  • Last Modified:

ERRO TitleWindow --> call method MDIWindow

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
0
eduardo12fox
Asked:
eduardo12fox
  • 5
  • 4
1 Solution
 
dgofmanCommented:
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 ();
0
 
eduardo12foxAuthor 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.
0
 
dgofmanCommented:
You have to use parentDocument instead parent

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

The parent instance is SystemManager class not "teste" class
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
eduardo12foxAuthor 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");
            
            }
0
 
dgofmanCommented:
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
0
 
eduardo12foxAuthor 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");  }
0
 
eduardo12foxAuthor 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.
0
 
dgofmanCommented:
Man are u kidding, why you just didn't replace calling function?

private function Abrir():void{
   (parentDocument as teste).AbraAlert();                  
}
0
 
eduardo12foxAuthor Commented:
Yes thanks dgofman
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now