I see some java code does a cleaner way to exit as shown in this code.
if(a!=1) {System.exit();}
//If equal 1, execute the code below
Is there any similar keyword for Actionscript to stop a function (not exit a loop or application) as alternative to break keyword?
private function isInt():void {
if(a!=1) { /* stop executing the code after these */ }
b=a;
}
The Java code you quote exits the entire process – it stops executing. Flash runs inside a host process such as a web browser which should not be arbitrarily shut down – what if the user had content on other tabs?
If you specifically wanted to send a signal to the hosting browser, you should use fscommand or the newer mechanisms and let the browser/web page decide what to do.
If you just want to prevent any more execution of your function, just use ‘return;’ to leave the function you’re in without doing any more processing.