I'm not sure on that but it may be correct.  The model variables I
references in the code below were set as follows in my app:

 

public static const            DATABASE_PATH                             :
String                    =
File.applicationStorageDirectory.nativePath;

public static const            DATABASE_FILE_NAME                :
String                    =             'stats.db';

 

the application storage directory by default (on XP) is C:\Documents and
Settings\USER_NAME\Application Data\APPLICATION_NAME

 

That's where I reference all my extra files out of.  I would think this
would still work with modules, wouldn't it?

 

Jake Churchill
CF Webtools
11204 Davenport, Ste. 100
Omaha, NE  68154
 <http://www.cfwebtools.com> http://www.cfwebtools.com
402-408-3733 x103

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of reflexactions
Sent: Wednesday, September 16, 2009 8:15 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How to add files when exporting air application

 

  

Thanks,
However I understood that for security reasons AIR apps are prevented from
writing to the application installation directory?

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> ,
"Jake Churchill" <j...@...> wrote:
>
> Include them in the root of your package and when your app runs, check for
> them in the install directory. If they are not there, move them there.
> Here's some code that I use to do this with an included DB file in an AIR
> app:
> 
> 
> 
> try
> 
> {
> 
> var
> dbSeed:File =
> File.applicationDirectory.resolvePath(ModelLocator.DATABASE_FILE_NAME);
> 
> 
> var dbPerm:File = new
>
File(ModelLocator.DATABASE_PATH+File.separator+ModelLocator.DATABASE_FILE_NA
> ME);
> 
> 
> 
> 
> 
> if( !dbPerm.exists )
> 
> 
> {
> 
> 
> trace("dbPerm File did NOT exist");
> 
> 
> dbSeed.copyTo(dbPerm);
> 
> 
> }
> 
> 
> else
> 
> 
> {
> 
> 
> trace("dbPerm File DID exist");
> 
> 
> // this overwrites the file no matter whether it exists or not
> 
> 
> //dbPerm.deleteFile();
> 
> 
> //dbSeed.copyTo(dbPerm);
> 
> 
> }
> 
> }
> 
> catch( err:Error )
> 
> {
> 
> trace(
> "[FileCopyError]: " + err.message );
> 
> }
> 
> 
> 
> 
> 
> Jake Churchill
> 
> CF Webtools
> 
> 11204 Davenport, Ste. 100
> 
> Omaha, NE 68154
> 
> http://www.cfwebtools.com
> 
> 402-408-3733 x103
> 
> 
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> ]
On
> Behalf Of reflexactions
> Sent: Wednesday, September 16, 2009 7:11 AM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] How to add files when exporting air application
> 
> 
> 
> 
> 
> If I want to add swf modules or a compiled css file that are all extern
(ie
> there is no explicit reference to them in the actual application code) and
> will be loaded at run time to an AIR package how do I do it?
> 
> Just to clarify, I can run the app just fine at the moment so long as I
> manually copy the swfs to the app install folder after installation, so
this
> isnt a question of how to make the app run with run time loaded modules,
its
> about how to get them into the .air file so they get installed initially.
> 
> Thanks
>



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.99/2372 - Release Date: 09/16/09
05:51:00

Reply via email to