Convert Multiple SWF files to Single EXE - apache-flex

Hi I have an application in flash, I build in ActionScript 3.0 Flash IDE, my application loads some external swfs which mentioned via XML file. Its working fine at the moment. But I need to compile all these external SWFs and xml file into single exe file. How can I compile like this. or how can I code like this?
EDIT: 1
from here : http://page-flip.com/products/pdf-publisher/
You can see an example, the application is build in .net and it import pdf and publish it as flash projector or web based(swf). How is it compiling all the external SWF files.

If you have Flash CS4 you can make use of the mxmlc compiler which has some additional tricks up it's sleeve.
Using the embed tag like this will allow you to embed an entire swf "inside" your swf:
[Embed(source = '../assets/items/9.swf')] public static const ITEM_9:Class;
Then, to instantiate it you simply go:
var mySprite:Sprite = new ITEM_9() as Sprite;
Using this and some clever overloading of your current classes for external loading should allow you to get a single swf (xml files can be embedded in a similar fashion).
Then it's just a matter of using the Publish settings to make Flash spit out an .exe
On an unrelated note, please go back and accept some answers to your questions. It's not very nice not to.

You can try mdm Zinc.
Zinc is really powerful. It lets you package your Flash or Flex in different ways, with lots of native platform hooks.

you can build an AIR application. if you don`t want it to be cross platform, you can build an AIR application with a windows native installer.

Flash > File > Project settings > Windows Projector.
For MAC, choose a MAC projector.
If you are burning to a disc and you need both platforms to work...a good option is to use Toast (if you are on a MAC)...it will hide the files you don't need the user to see, and also hide windows files from MACs and vice versa.

There is an application for Windows called SWFKit, which allows you to package your SWF and external files into one exe file. I had the same problem as you, and this worked a treat for me. Unfortunately you do need to pay for it :( http://www.swfkit.com
Hope this helps,
Will

I would go about it with these steps
create a flex application
embed all of the SWF's and the XML into that application
create a release of the application you just created
open the SWF application with the stand-alone flash player and not with the browser
from the file menu select the option create projector
All of this will result a single EXE file that contains all of the SWF's and the XML file.

You can use a projector or make an windows only AIR project.

Use flajector and forget about your problems

Related

Importing flex compiled swf into a flash file

I've built a form in Flex.
When I run the flex project, I get a html file with some js, css and swf files (NOT A SINGLE FILE), swz files.
When I run the main swf file alone, many things are working perfectly except at places where it needs to send a HTTPService request.
When I use the html file, all works fine.
Now I want to do the following.
Import this form made in flex into a flash site (actionscript 3)
This form has various ViewStacks, where the user will be travelling through these. I want to reload the form back to its initial stage when the user wants to fill the fields again.
Can there be any request sent to the Flash Site from this FORM, regarding the form submission success ?
Can I compile the Flex Project to one single swf file, so that I can use this swf file without any Browser?
Can I convert the webpage application Flex Project to an Adobe AIR application ?
Details:
I used flash builder 4... and flex 3 coding as in
<mx:Application/>
mx namespace is "http://www.adobe.com/2006/mxml"
and no "s", or "fx" namespaces defined.
I'm sorry I can't answer all your questions, but I can answer:
Import this form made in flex into a flash site (actionscript 3)
I don't see why not, although I never did that myself; typically it's the other way around as Flex swf are really more applications than regular flash swf typically are.
Can I compile the Flex Project to one single swf file, so that I can
use this swf file without any Browser?
Yes you can:
With Flash Builder, go to Project->Properties->Flex Build Path, and
change Framework Linkage to Merge Into Code
When invoking the mxmlc compiler directly, use the option -static-link-runtime-shared-libraries=true
Can I convert the webpage application Flex Project to an Adobe AIR
application ?
Yes you can by right-clicking your project in the Package Explorer window, and under Add/Change Project Type, you get make your project an Air application.

Is it possible to start an Adobe Flex app on OS X with just the AIR runtime and the .swf

I know it is possible to run an Adobe Flex compiled .swf from the command-line using the adl command-line tool.
Is there an equivalent way to run a Flex .swf from the command-line using the system installed AIR runtime?
My question applies to OS X, but I'd interested to know about other platforms also.
UPDATE: This question is now somewhat obsolete. As of AIR 3, there is now an 'officially supported' way to bundle the AIR runtime with an application, using the 'captive runtime' deployment option.
I just tested to run an AIR app without the need to install the application.
Copy the following folders from your Flex SDK
bin
runtimes\air
as well as all files from your "release" (bin-debug) folder of your project.(Don't build a release build!).
now you can run the application with "adl app.xml".
Though there was AIR runtime installed on the PC I think it should be possible without it too.
The original question was a bit different though, maybe it's helpful anyway.
I say No! A SWF is not the same as an AIR application. If you take that SWF's code and compile it into an AIR application; then you should be able to install and run it independent of the browser or any development tools.
I suppose in theory you could create an AIR application where you give it the location of a SWF and use SWFLoader to load the actual SWF. I don't think that is quite what you're after.
There is a stand alone Flash Player which is different from AIR and different from the browser plugin. You can get it here. You can use that to run the SWF as if it were a local app. I wouldn't count on your users having that, though.
You can also load a local SWF in the browser and let the flash player plugin handle it.

Enable Icons ADL

I can't seem to work out how to enable icons in the AIR Debug Launcher. This seems to work on Linux, but when I run it on Windows or Mac only the Adobe AIR icon shows. I have specified the location of the icon in <icon></icon> in the application descriptor file.
Those icons are created from the file references in the application descriptor file when the application installs itself so you won't really be able to see them during development.
There is a solution available on Christian Cantrell's Adobe blog that works around this though the instructions are from February 2008. This may or may not work with the latest Flex SDK or Flex/Flash Builder IDE.
Fortunately, I’ve found an easy way to make this work. Here’s what you do:
Make a copy of your application icon and name it something different. One version should be referenced by your application descriptor file, and the other will be compiled into your application. (You don’t technically have to make a copy of the icon, but when generating a release build of your application, Flex Builder doesn’t copy over embedded resources which means your application icon will be missing. Trust me when I tell you that it’s easier to create a copy and avoid this whole issue.)
Compile the copy of your application icon into your application using code like this:
[Embed(source="assets/application.png")] public var appIconClass:Class;
In your application’s initialization code, create a Bitmap instance of your icon like this:
var appIcon:Bitmap = new appIconClass();
Set your icon like this:
InteractiveIcon(NativeApplication.nativeApplication.icon).bitmaps = [appIcon];
This code is a little oversimplified because it doesn’t take platform differences into account. A more complete implementation might do something like this:
Check to see what kinds of icons the client supports. You can do this with the NativeApplication.supportsDockIcon and NativeApplication.supportsSystemTrayIcon APIs.
Scale the Bitmap to the appropriate dimensions for the platform.
Set the icon(s) using the NativeApplication’s icon property.

Possible: use Flex/Air to build a chromeless CD autorun app

We'd like to have an app autorun when our clients put in our info CD.
Is it possible to do this using Adobe AIR... We were thinking of using the Flash Projector cause it compiles to an .exe which is easily launched, but there's no way to get rid of the ugly window chrome is there?
AIR Apps have to be installed right?
Thanks
It isn't going to work with AIR, but there are numerous Flash projectors that would work. AIR needs the runtime and has to be installed.
I had the same requirements and ended up using zinc. You can't get an AIR app to launch without installing it (much assuming that the user has the runtime in the first place) but zinc allows you to do so AND deploy to multiple environments like AIR with custom chrome if need be...Good Luck!
You can't do it with AIR. In fact that was one of the key design points of AIR, that you couldn't do automatic execution.
You can theoretically do it with a .EXE projector file, but it requires some fancy footwork, and I don't think you can output Flex to Projector.

Open exe file from Flex3 Air

I have .exe file, which is done in VB. i need to open or hit that exe file from Flex3 air application on Button Click event.
i need to simple hit that exe file to run, no need to open inside the air applcation.
How to hit the exe file in Air app...?
Thanks in Advance
Air itself does not provide the ability to launch external applications (I see this as a significant problem with AIR).
Some people have created a hack that would allow you to do this and provided it as a library, though I'm not sure how reliable it is (it does some weird things with the way Windows loads DLLs that I'm not sure I completely trust).
Aperture framework: http://aperture.fluorinefx.com/
Blog discussing the implementation: http://blog.fluorinefx.com/?tag=native
As Herms said, AIR doesn't allow you to do that. However, Java does and you can connect your AIR app with Java using merapi.
For now, the best and easiest way to do this is, as Amarhosh said, to use Merapi. Or you can wait to AIR 2.0 (the end of 2009) which will bring native access support.
AIR 2.0 will support using NativeProcess.

Resources