Not the only way to do it, but I just write a file in the app storage directory
:
private function isFirstRun():Boolean
{
var firstRun:Boolean = false;
var firstRunFile:File =
File.applicationStorageDirectory.resolvePath("firstrun.txt");
if (!firstRunFile.exists)
{
firstRun = true;
}
//testing only - you can set this preference in the
CARTMAN window.
if (!firstRun)
{
firstRun = appModel.prefsManager.alwaysShowEula;
}
return firstRun;
}
and somewhere else ...
// write the firstrun file here
var firstRunFile:File =
File.applicationStorageDirectory.resolvePath("firstrun.txt");
var stream:FileStream = new FileStream();
stream.open(firstRunFile,FileMode.WRITE);
stream.writeUTFBytes("eulaShown");
stream.close();
You can ignore the bit commented with "testing only", but it can be handy to
have an option to always show the licence agreement.
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of
bobby_world
Sent: 27 November 2008 12:53
To: [email protected]
Subject: [flexcoders] Window on First Run of Application
I want to create a Software Registration Window that pop up on the
first time a user starts an Application in AIR. Is this possible and
how would I go about doing this?
Thanks
Bobby
______________________________________________________________________
This communication is from Primal Pictures Ltd., a company registered in
England and Wales with registration No. 02622298 and registered office: 4th
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT
registration No. 648874577.
This e-mail is confidential and may be privileged. It may be read, copied and
used only by the intended recipient. If you have received it in error, please
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637
1010. Please then delete the e-mail and do not disclose its contents to any
person.
This email has been scanned for Primal Pictures by the MessageLabs Email
Security System.
______________________________________________________________________