Answer the question
In order to leave comments, you need to log in
@%#$! Flash player security policy and more?
Hello hackers.
Help me solve the problem, I've been fighting for three hours, no less.
What do I want to do?
I want to make some kind of wrapper.
Those. the flash drive loads another flash drive inside itself, then work with the loaded flash drive (addChild, interactive).
I use the following code in wrapper:
public function Main():void <br/>
{<br/>
if (stage) init();<br/>
else this.addEventListener(Event.ADDED_TO_STAGE, init);<br/>
}<br/>
<br/>
public function init(event:Event = null):void<br/>
{<br/>
this.removeEventListener(Event.ADDED_TO_STAGE, init);<br/>
<br/>
stage.dispatchEvent(new Event(Event.DEACTIVATE)); <br/>
stage.dispatchEvent(new Event(Event.ACTIVATE));<br/>
<br/>
<br/>
loadExeption();<br/>
}<br/>
<br/>
public function loadExeption():void<br/>
{<br/>
<br/>
Security.allowDomain("*"); <br/>
Security.allowInsecureDomain("*");<br/>
<br/>
loaderContext = new LoaderContext();<br/>
loaderContext.checkPolicyFile = true;<br/>
<br/>
if (Security.sandboxType != 'localTrusted') <br/>
{<br/>
loaderContext.applicationDomain = ApplicationDomain.currentDomain;<br/>
loaderContext.securityDomain = SecurityDomain.currentDomain;<br/>
}<br/>
<br/>
m_loader = new Loader();<br/>
m_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);<br/>
<br/>
m_loader.load(new URLRequest("xxx.ru/my.swf"), loaderContext);<br/>
}<br/>
<br/>
public function onCompleteHandler(e:Event):void<br/>
{<br/>
addChild(m_loader);<br/>
}
<cross-domain-policy><br/>
<site-control permitted-cross-domain-policies="master-only"/><br/>
<allow-http-request-headers-from domain="xxx.ru" headers="*"/><br/>
<allow-access-from domain="xxx.ru" to-ports="80"/><br/>
</cross-domain-policy>
...<br/>
var params = {<br/>
menu: "false",<br/>
scale: "noScale",<br/>
allowFullscreen: "true",<br/>
allowScriptAccess: "always",<br/>
allowNetworking: "always",<br/>
bgcolor: "#000000"<br/>
};<br/>
...<br/>
swfobject.embedSWF("preloader.swf", "altContent", "600", "580", "10.0.0", "expressInstall.swf", flashvars, params, attributes);<br/>
Answer the question
In order to leave comments, you need to log in
I actually found the solution myself.
Solution:
The main class of the loaded flash drive must be different from the main wrapper class. In my case it was Main<->Main. Actually, there were such glitches.
It was worth changing to Wrapper <-> Main, as everything worked.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question