When you do this:
<custom:Button_Component id="comp" height="87"
initialCount="true,false,true" />

The Flex Framework will set the properties of the component
before it will create its children (technically, the setting of
properties and the creation of children can be somewhat mixed, but
the point is you cannot rely on the children being created before
any properties are set).

The initialCount property function is being called which then
tries to change visible properties of the children; the children
are not created yet and are thus null.

Property setter and getter functions should not change the
properties of UI children. Instead, have those functions call
invalidateProperties() and override the commitProperties()
function. Inside of commitProperties() you can then set those
childrens' properties. This is a standard technique used
throughtout the Flex source code.

hi
Could please explain how i need to add the code in my mxml .
it'll be helpfull for me ...

There are 10 mxml file are there . each file contain three
button , so user need to call the component file when he need the
three button are two button by setting the property
initialCount="true,false,true" .
~~
Sk

In the component, you can add a Event Listener and Handler
for the creationComplete Event (which is triggered after all
children have been created), and then in the Handler Function, set
the visible property of each button to the value in the
initialCount Array (see attached code). This is how I usually
handle cases like this.

hi eric
Thanks for ur reply
but i am facing some problem initialCount="false,true,true"
var _mySubArray:Array = _initialCount[0].split(",");
Alert.show(_mySubArray[0]+"--"+_mySubArray[1]+"--"+_mySubArray[2]);
vans_but.visible = Boolean(_mySubArray[0]);
try_but.visible = Boolean(_mySubArray[1]);
sol_but.visible = Boolean(_mySubArray[2]);
it is not working.if i pass the value like this means
initialCount="0,1,1" it's working fine.
where i did the mistake
~~
Sk

Do you have to use a String or can you use an Array of 3
Boolean: initialCount="[true,false,true]" ? This would eliminate
the need to turn the Strings into Booleans. Then you would have
something like vans_but.visible=initialCount[0]; making your code a
lot simpler.

Hi peterent,
thanks for ur answer it's working fine.but if i need to pass
the value like this
when i pressed any button
comp.initialCount="false,true,true"; it's not working fine. can you
help me hw to solve this issue
~~
Sk

Hi peterent,
Actually i have used this ="[true,false,true]" in anchor tag
<custom:Button_Component id="comp" height="87"
visibility="[true,false,true]" x="304" y="514" />.
it's working fine .
But if i pressed the answer button remaining two button are
become invisible i.e( try_but ans sol_but). so hw should i call the
function
comp.visibility ="[true,false,true]";

i got the error like this
1067: Implicit coercion of a value of type String to an
unrelated type Array.

i do't know where i did the mistake . if you could help me
then it'll be very much need full for me