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:flexcod...@yahoogroups.com] On
Behalf Of reflexactions
Sent: Wednesday, September 16, 2009 7:11 AM
To: flexcoders@yahoogroups.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



Reply via email to