Static / private child component in mxml?

Is there a way to declare a child component in mxml that is private / protected or even static?

Of course, we can do this inside the script tag, but is there any other way?

+4
source share
3 answers

Ashier suggests using the Exclude metadata tag, but Maskit offers its limitations and offers alternative solutions:

http://blog.ashier.com/2008/03/25/hiding-properties-in-flex-components/
http://smaskit.blogspot.com/2008/07/making-mxml-subcomponent-private.html

+2
source

In the strict sense of these terms, you cannot do this with mxml. The second post posted by Louis contains some ways to circumvent private / protected behavior.

0
source

I found a solution to a static question. I need a quick notebook, access to which could be found anywhere in the mobile application, without editing one instance left open on another screen.

I created the mxml control for the memo pad and then placed it inside the declarations section of a top-level mxml application. In each view that I wanted the note to appear, I added:

import mx.core.FlexGlobals; import components.QuickMemo; private var memo:QuickMemo; 

At the end of the creation:

 memo = FlexGlobals.topLevelApplication.memo; 

In the viewActivation code, I added:

 memo.visible = false; addElement(memo); 

In the viewDeactivation code, I included:

 removeElement(memo); 

The net effect is that at any time there is only one copy of the note, and one copy opens in any state that existed in the last view in which it appeared.

0
source

All Articles