How can I access allowScriptAccess value from Flash?

I am looking to read the value of the allowScriptAccess tag so that if it is set to "never" or if it is not set, I will not try to make an ExternalInterface call. Using the flex framework, I can use Application.application. Is there an equivalent for flash?

+3
source share
3 answers

It is fairly well documented that access to these parameter values ​​is not possible from Flex or Flash. Access to Flashvars can be obtained in accordance with the previous answer, but the parameter values ​​of the object tag cannot be.

+1
source

allowScriptAccess, , ExternalInterface try-catch.

try
{
  ExternalInterface.call( 'document.getElementById', 'NOELEMENTBYTHISNAME' );
  allowScriptAccess = true;
}
catch( err:SecurityError )
{
  allowScriptAccess = false;
}

allowScriptAccess , ExternalInterface.

+2

Such information, along with any parameter of the query string, can be obtained through the flashVars property. You can access the properties of flashVars. Read this for a detailed discussion. Equivalent to Flash Application.application.parametersequals stage.loaderInfo.parameters.

This blog explains how you can do this in a consistent manner.

0
source

Source: https://habr.com/ru/post/1703976/


All Articles