3

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

user663738
  • 31
  • 2

2 Answers2

2

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>
www0z0k
  • 4,400
  • 2
  • 25
  • 32
1

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.

alxx
  • 9,882
  • 4
  • 24
  • 40