suppressing output of a function in PHP. disabling echo just for a function in PHP

Have you ever had a situation where you had to call a function just to return its value without echoing anything ? May be disabling some errors or debugging messages ? I've been fiddling around with this for a while and I figured meddling with the Output Bugger might help.

function foo() {
echo "Flush!";
return true;
}

If you want to call foo() without echoing Flush! but you want $a to have the return value of foo().This is what you will do.

ob_start();
$a = foo();
ob_end_clean();

Just turn it on before you call your method that would output (not the function itself, but where you call it, you could wrap it around your whole script or the script flow, but you can make it as "tight" as possible by just wrapping it around the call of the method. For more information see http://php.net/outcontrol

Add a Focus Loop to Adobe Flex PopUpManager

This took me a whole frigging day to figure out.

In a project I created a custom PopUp, nothing big, just a custom component from the Group Class which will have some text inputs and a few buttons.

The Documentation about the IFocusManager states that a pop up will get its own FocusManager and its own tab loop. After some tracing I found that my pop up and its child weren’t included in the FocusManager as focus objects. In fact, there was no FocusManager for my pop up at all. The reason for this is that when the PopUpMangerImpl is about to create and configure the pop up, it checks if the pop up is a IFocusManagerContainer so that focus can be added. Unfortunately my popup was a Group which does not implement the IFocusManagerContainer interface. Naturally no FocusManager would be created. If you want to use a Spark Group as your pop up, the solution is to create a new class that extends from Group and implements the IFocusManagerContainer. Then use this class as the container for the pop up.

OR As a quick and dirty fix, you can just make your group container a "Skinnable Container" which implements IFocusManagerContainer automatically. Teh trade off here is that you will have the overhead of skinnable container in your project.