user663738
user663738

Reputation: 31

How to create an AIR application in Flash Builder 4 without mxml

I am an actionscript developer and I know nothing when it comes to mxml. recently switched to using flash builder and I really like it but I want to create an AIR application in flash builder but I don't want to use mxml since I don't need any of the built in framework to accomplish my goal.

  1. Is that possible?
  2. If I have to use mxml to start the application how do I use .as files with .mxml files?

So far I have been able to import a .as file, but I can't use addChild(). If I can get some help on how to do that I would be so grateful I have spent hours on end failing at this. Thanks

Upvotes: 3

Views: 1139

Answers (2)

alxx
alxx

Reputation: 9897

Recent versions of FlashBuilder allow for creation actionscript AIR project directly. If this isn't your case, just create new AIR MXML application, add new actionscript class and set it as default application. Then you can remove MXML. Also see this for details.

Upvotes: 1

www0z0k
www0z0k

Reputation: 4434

create a class (in .as file) extending UIComponent and use it as a root display object, add a creationComplete listener in the constructor and use it as an entry point.
and so the only mxml code you need is:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:mx="library://ns.adobe.com/flex/halo"
                xmlns:loc="*"
                xmlns:s="library://ns.adobe.com/flex/spark>
      <loc:YourRootClass/>
</s:Application>

Upvotes: 2

Related Questions