Flex application security error on Fullscreen mode

Have spot this error when I tried to implement fullscreen mode on my Flex app.

Here is my fullscreen toggler:



        private function toggleFullscreen():void {
            try {
                switch (stage.displayState) {
                    case StageDisplayState.FULL_SCREEN:
                        /* If already in full screen mode, switch to normal mode. */
                        stage.displayState = StageDisplayState.NORMAL;
                        stage.fullScreenSourceRect = appRectangle;
                        break;
                    default:
                        /* If not in full screen mode, switch to full screen mode. */
                        stage.displayState = StageDisplayState.FULL_SCREEN;
                        appRectangle = stage.fullScreenSourceRect;
                        stage.fullScreenSourceRect = new Rectangle(0, 0, 1000, 750);
                        break;
                }
            } catch (err:SecurityError) {
                // ignore
                Alert.show('Cannot go full screen');
            }
        }

When I press fullscreen icon I’ve got this exception.
The problem was simple – you need to allow your app go to fullscreen mode like this:

        <param name="allowFullScreen" value="true" /> - in the <object>
        allowFullScreen="true" - in the <embed>

How to stop Symfony project execution from a filter

When you need to stop execution of your project from a Symfony filter, for example, when you’re checking all requests to your application for some correct GUID, you need to do one simple thing:

[php]
<?php
/**
* Checks the GUID and allow/deny the request
*/
class sfCheckGUIDFilter extends sfFilter
{

public function execute($filterChain)
{
$sfContext = $this->getContext();
if ($this->isGUIDCorrect($sfContext->getRequest()->getParameter(‘GUID’))) {
$filterChain->execute();
} else {
$response = $sfContext->getResponse();
$response->setStatusCode(403);
$response->setHttpHeader(‘Content-Type’, ‘text/plain’, true);
$response->setContent(‘Not allowed’);
$response->sendContent();
}
}

private function isGUIDCorrect($guid) {
// TODO: implement your GUID checker
}
}
[/php]

and in the filters.yml file of your application you just add this filter in a following way:

[php]
# You can find more information about this file on the symfony website:
# http://www.symfony-project.org/reference/1_4/en/12-Filters

rendering: ~
security: ~

# insert your own filters here
guid_checker:
class: sfCheckGUIDFilter

cache: ~
execution: ~
[/php]

In this case this filter is used for entire application. When you need to cover with checker only few actions please use other ways, like preExecute method of an Action.