PDA

View Full Version : visibility question


arnaldo
08-20-2007, 10:47 AM
Hello everyone!

Suppose I have views A and B such that B is inside A. If I set A's visible attribute to false, B also disappears. However, B's visible attribute remains true. Is there a way to determine whether a view is really visible?

senshi
08-20-2007, 01:17 PM
What about checking for visible on all "immediateparents" up to the canvas?


<method name="isVisible" args="v" >
var sview = v;
while (sview != canvas) {
if (!sview.visible) {
return false;
}
sview = sview.immediateparent;
}

return true;
</method>

arnaldo
08-21-2007, 03:43 AM
What about checking for visible on all "immediateparents" up to the canvas?
I was trying to avoid traversing all the immediateparents, but I guess there is no other way. Thanks Senshi!