I would like to remove a fullscreen button if the allowfullscreen param is false.
param value="true" name="allowfullscreen"
Does anyone know if its possible to detect that value? It doesn't come with other flashvars on loaderInfo.parameters.
The member you want is
stage.displayState
It can be assigned like so:
import flash.display.StageDisplayState;
....
stage.displayState = StageDisplayState.FULL_SCREEN;
stage.displayState = StageDisplayState.NORMAL;
I recommend reading:
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000352.html
[Edit:
Oh man, totally misread your question.]
After a little test it looks like you can just use the exception mechanism to test for it without any perceptable flicker:
try
{
stage.displayState = StageDisplayState.FULL_SCREEN;
stage.displayState = StageDisplayState.NORMAL;
} catch ( error:SecurityError ) {
// your hide button code
}
SOLUTION FOR AS3
you can check if full screen is allowed via the stage properties, example for my case
try {
if (btn.stage["allowsFullScreen"]) { // if this fails, then its not allowed
// do full screen allow code here
btn.alpha = 1; // show since its allowed
}
} catch (error:Error) { // full scrren not allowed
btn.alpha = 0.5; // dim since it cant be used
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With