I am trying to make a mxml component which will work like the
JSP tag SKIP_BODY. In other words, it will take a component and a
boolean. When the boolean is set to true it will show the "child"
component and when it's false it will remove it.
For the moment I made something which uses a Box (see the
The problem is that I don't want to use a Box or any other
layout related component, because my objective is to use my
component as a "meta mxml tag" which will manage security access
inside my application and thus must not interfere with the layout
of the UI components.
Has someone already done this kind of things ?
That will be tough. Remember, mxml is just the first step. It
gets generated into AS, then compiled into a swf. So you won't
really have conditional compilation, but rather conditional
You could toggle visible and includeInLayout properties to
display or hide a component conditionally. If SecurityChecker just
set these based on the bound value, then you would get the effect
you want, I believe.
Also, consider using Repeater to instantiate the components
based on a dataProvider. that is not a declaritive solution, but is
often used for conditional rendering.
Or you could do it the hard way and extend UIComponent, and