PDA

View Full Version : Reboot System from Flash



kkertz
September 21st, 2009, 02:13 PM
Hello all,
A client asked if it's possible to reboot the system using a button from flash after the viewer has watched the flash presentation?

From Visual Basic, executing the command "Environment.Exit(-4)" will shutdown and restart the program. This actually exits the control program and the watchdog program that is running in the background then restarts the main program.  The -4 is not particularly important, but it is currently designed to look for an exit code with a negative value.

Is this possible to execute the "Environment.Exit(-4)" command using AS3?

Any help is much appreciated. Thanks!

efos
September 21st, 2009, 02:22 PM
No.

...Yes. If you slap your swf in a C++/# wrapper you can access C functions with ExternalInterface.call(). So technically, yes, but not from a browser or a standard flash player.

senocular
September 21st, 2009, 02:41 PM
I wouldn't be too happy if a banner ad caused me to reboot :trout:

kkertz
September 21st, 2009, 03:03 PM
Thanks guys. Yep... rebooting ad banners would be a nightmare!

How about having a background program monitor a XML file that indicates the status of the flash file. Then change the file when the user hits quit? The main program could then be restarted...