Sometimes we do not want user to launch multiple instances of a standalone(projector) Macromedia Flash application. A friend of mine had similar requirement and I came with a simple script that stops another instance from running. I am using LocalConnection Object for this and I know, you guessed it right? Yeah its very simple and intuitive approach.
Place the following code on the first frame of the application, before any other code.
var _lc:LocalConnection = new LocalConnection();
if(!_lc.connect("myapp")) {
//You can handle the event in any way you want,
//I am here just closing the projector.
fscommand("quit");
}
So as soon as another instance is launched, it would check if connectionName(myapp) is in use, if yes then it quits. Hope it helps someone.
If you wish to advertize on iGeeks, please contact the manager for the same.
iGeeks would love to publish your technical articles; contact the manager if you wish to write for iGeeks.

brajeshwar [at] brajeshwar.com
Comments
There are no comments for this post so far.
Post a comment