To make the SWF obsolete in other domains, you can use the SecurityDomain.currentDomain.domainID
command. This feature returns a unique swf hosting domain ID through the singleton SecurityDomain . So you can check if the file is in the pre-defined domain.
if(SecurityDomain.currentDomain.domainID == "0A806C77AC090336AB036671325939AA720863AE7F89194428B0751457893451") {
//iniciar código;
}
Another way, is to use Security.pageDomain
, this method returns the String of the domain that swf is hosting.
if(Security.pageDomain == "http://www.seusiste.com.br/") {
//iniciar código;
}
To prevent other swfs from being able to load your swf, you need to use just the code you mentioned Security.allowDomain () . Passing as a parameter the domain that is able to import your swf.
Security.allowDomain("http://www.seudominio.com.br/");