RE: [flexcoders] How to add files when exporting air application

2009-09-16 Thread Jim Hayes
 
In flexbuilder, to get those files into your .air package, try the
following :
 
Either
 
 tick "copy non embedded files to output folder" in
project|properties|flex compiler", and with a bit of luck when you
publish your .air from FB they will appear in the "Air file contents"
screen included files list for you to check or uncheck as necessary.
Personally I find this way to be not quite fitting with my sloppy ways,
and sometimes seemed a little unreliable.
 
The other option is to get to that screen (keep hitting Next button),
whereby the "bin-release" folder will be created, then copy your extra
files into that. Hit "back" button in the export screen, then "next" to
get back to where you were, only this time you should see and be able to
include your files.
 
Both of these get old fairly quickly if you need to do it a lot, I found
that an ant script saved me a ton of time and aggro for compiling and
packaging air projects.
 
 
-Original Message-
From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of reflexactions
Sent: 16 September 2009 13:11
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


__
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.
__

RE: [flexcoders] How to add files when exporting air application

2009-09-16 Thread Jake Churchill
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