1 person found this helpful
I assume you've also called ExternalInterface.addCallback? Do you know if
the preinitialize handler ran before JS attempst the call?
Everything is working fine when I use the 2 same domains, so addCallBack does its job as expected...
The JS function is called well after the preinit handler, I made sure through step by step debugging...
No other Security.* call happens apart from the allowDomain one, just loading crossdomain policy for a server side call which works perfectly from another domain...
I have added a call to Security.allowDomain("*") just before the ExternalInterface.addCallback as well (me being desperate!), and it worked
It has been added in my "class ExternalInterfaceMediator extends Mediator implements IMediator" where I addCallback....
This method was in one of the external library.... Does this mean the allowDomain calls must reside in every different libraries/main swf registering the callback??
Damn me if that is so!
Security.allowDomain() only applies to the swf it is called from. If you want to allow access to multiple swfs then you will need to call Security.allowDomain() from each swf.
There must be code in a SWF that calls allowDomain in order to allow code in
that SWF to be called. So, if you are using modules or sub-apps or RSLs, if
code in those SWFs are the callback, you need to have code in those SWFs
that call allowDomain. Calling allowDomain from the main app's code only
helps for code in the main SWF.
There is a function on IFlexModuleFactory that calls allowDomain on all
known modules and RSLs.
Thank you for the IFlexModuleFactory advice!