Adobe Integrated Runtime (AIR) for JavaScript Developers Pocket Reference

(nextflipdebug5) #1
Command-Line Arguments | 127

function doStmtError( event )
{
alert( "There has been a problem executing a
statement:\n" + event.error.message );
}

function doUnload()
{
db.close();
}
</script>

</head>
<body onload="doLoad()" onunload="doUnload()">

</body>
</html>

Command-Line Arguments


Capturing Command-Line Arguments


Problem


You need to capture command-line arguments sent to your
application—either at application startup, or while the appli-
cation is running.


Solution


Register for theInvokeEvent, and capture command line
arguments passed into your application.


Discussion


Whenever an application is started, or an application is
called from the command line while it is running, an
InvokeEventwill be broadcast. The event handler for this is
passed information about the event, including any argu-
ments passed to the application on the command line.

Free download pdf