View unanswered posts | View active topics



Reply to topic  [ 10 posts ] 
AIR - Flex3 
Author Message
Member

Joined: Wed Apr 11, 2007 4:49 pm
Posts: 6
Location: London, England
hi there

Im really confused now that we have so many updates; I downloaded Flex 3 SDK beta, AIR beta & AIR SDK beta and Flashdevelop 3 beta2.
now I have no idea how to create a simple AIR file :oops:
any idea anyone?
how should I start?

thanks!


Wed Jun 13, 2007 12:28 pm
Profile
Member

Joined: Tue Nov 08, 2005 5:49 pm
Posts: 190
Location: Silicon Valley
Post 
I'd recommend building your first AIR application in the Flex Builder 3 beta. It has a useful AIR project type that will make your first application easier to create.

_________________
Josh
zeuslabs.us


Wed Jun 13, 2007 7:58 pm
Profile WWW
Member

Joined: Wed Apr 11, 2007 4:49 pm
Posts: 6
Location: London, England
Post 
ah! :oops:

good idea. I will download the builder now. By the way, is a swf file with Actionscript 2 and I want it transparent (chromeless), how can I make a close button? I've drawn an "X" on my file but have no clue which code to use to close the .air app... :?
thanks for your reply


Wed Jun 13, 2007 8:16 pm
Profile
Member

Joined: Tue Jul 03, 2007 2:01 pm
Posts: 8
Post 
so, still no news about flex3, air, and working templates?
I can't get this work together.

Eclipse, tfu. I will never install this :)


Tue Jul 03, 2007 2:05 pm
Profile
Member

Joined: Mon Dec 04, 2006 6:20 pm
Posts: 14
Post 
I've managed to do it somewhat cleanly and I'll explain the process of creating an AIR template.



1. Flex 3 SDK

Firstly, you'll need to replace your Flex 2 SDK that you are using to compile AS3/MXML projects with the Flex 3 SDK beta, but backup the old SDK first, just to be sure :)

Now as far as I know, Flex 3 isn't officially supported in FD3, but it should be backwards compatible with Flex 2, so you shouldn't have any problems compiling the same projects you did with Flex 2 (worked for me fine, but I'm not using the framework itself, so you might have problems with MXML files, I doubt it though).
Don't forget to change the path to the SDK, if you installed Flex 3 somewhere else, also, don't bother downloading the AIR SDK, since I've found that it was kinda missing a lot of files. Flex 3 SDK actually includes the AIR SDK.



2. Making the template file

Duplicate an AS3 template of your choice (but you might want to start with the "Empty Project" one, to be sure that it works).



3. Creating an application descriptor file

If you've used Apollo or AIR before, you might recall that you need an xml file that acts like a project file for AIR ("application descriptor file"), in which you specify properties such as name and description of your application (more info at Defining properties in the application descriptor file). For the "rootContent" parameter, you can use "$(OutputName).swf" in the template, to use the swf file that has the same name as the project by default in FD.



4. Getting the template project file ready for AIR

After you've made the xml file, open the project template file in FlashDevelop and go into the project properties. In the "Compiler Options" tab, add "+configname=air" to the "Additional Compiler Options" field to tell the SDK to use the default AIR configuration file.



5. Setting up the debug launcher

You'll probably want to test your project after it has been compiled. For that, you have to enter a path to the "AIR Debug Launcher" and tell it to use your xml descriptor file, in the "Post-Build Command Line" under the "Build" tab in project properties.
For example:
Code:
"C:\Program Files\FlashDevelop\FlexSDK\bin\adl.exe" $(ProjectName).xml

That would launch the debug launcher using an xml file that's the same as the project name*.
You will probably need to use F8** to compile instead of F5 (test movie), because F5 opens the swf file with the flash player too, which obviously don't know what to do with AIR commands :)



6. Adding intrinsic classes

If you want autocomplete for AIR classes too, you'll have to replace the AS3 intrinsic classes (located in "\FirstRun\Library\AS3\intrinsic") with Flex 3 intrinsic classes, which were kindly created for us by brainy :D
Now the only downside that I can see with that is that you are going to get AIR classes in AS3 projects too, but for me, autocomplete outweighs that :)




That should be it, you should be able to create a project with the AIR template normally (but you might want to rename the descriptor xml file to the project name*).
I hope this helped and if you have any questions, ask away :)


also, thanks to brainy for digging out that descriptor help page (:



* I don't think that there is any way to make the project files be renamed accordingly to the project name (so if you create a project named "RadialBrowser" for example, that FlashDevelop would create an xml file named "RadialBrowser.xml"). Would it be possible to add such functionality to FlashDevelop somehow? :)

** For compiling, would it be possible to add an option that means something like "I have a test launcher that I want to manage myself and don't want to use the flash player", so it would be possible to compile AIR apps using F5, or am I just talking nonsense? :D


Thu Jul 05, 2007 1:24 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Post 
Quote:
* I don't think that there is any way to make the project files be renamed accordingly to the project name (so if you create a project named "RadialBrowser" for example, that FlashDevelop would create an xml file named "RadialBrowser.xml"). Would it be possible to add such functionality to FlashDevelop somehow?

** For compiling, would it be possible to add an option that means something like "I have a test launcher that I want to manage myself and don't want to use the flash player", so it would be possible to compile AIR apps using F5, or am I just talking nonsense?

Both are good suggestions - we'll check that.


Thu Jul 05, 2007 2:14 pm
Profile WWW
Member

Joined: Mon Dec 04, 2006 6:20 pm
Posts: 14
Post 
Thanks :D


Thu Jul 05, 2007 2:19 pm
Profile
Member

Joined: Mon Dec 04, 2006 6:20 pm
Posts: 14
Post 
I just remembered, it would be nice if we could specify a default location or something like that in the template file, that would specify the default location where the project file (or folder) should be saved. Maybe you could have a checkbox next to "Location" somewhere, that would grey out the location field and display the default location.
It would be nice to have that kind of functionality, so I could keep my Actionscript 3 projects in my AS3 folder and AIR projects in my AIR folder without having to change the path every time I switch between them.

But that's just minor :D


Sat Jul 07, 2007 2:58 pm
Profile
Member

Joined: Tue Jul 03, 2007 8:45 am
Posts: 5
Location: spb.ru
Post 
I got problem with Flex3 intrinsic classes: the String class shows only 1 property: length. So I left the String class from original AS3 intrinsic classes.


Thu Jul 19, 2007 10:12 pm
Profile
Member

Joined: Sun Apr 23, 2006 2:55 am
Posts: 204
Location: Sydney, Australia
Post 
You can stop flashdevelop from launching the app itself by selecting custom under the "Open swf in:" dialog in the project properties.

How would you go about getting an application created in this way to trace?


Fri Sep 28, 2007 4:41 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.