To prevent your Flex app from running on certain domains, you’ll need to use JS to check the current domain, and then decide how to disable your application.
Here’s the sample code to retrieve the domain (you’ll notice it takes advantage of the getWindowLocation() method I defined in an earlier post last year):
There are several easy ways to disable your application. It all depends on how crafty you want to be about it.
You can check the current domain on preinitialize, for example, and simply never display the UI for a restricted domain (more on that here).
Or you can opt for the classic approach, and open an “undismissable” modal dialog to prevent the user from ever interacting with your application.
(or you can just translate everything into Japanese and invert all the colors… the sky’s the limit!) 🙂