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

I am an ActionScript developer and don't know anything when it comes to mxml. I recently switched to using the Flash linker, and I really like it, but I want to create an AIR application in the Flash linker, but I do not want to use mxml, since I do not need any built-in infrastructure to achieve my goal.

  • Is it possible?
  • If I need to use mxml to run the application, how to use .as files with .mxml files?

So far, I have been able to import the .as file, but I cannot use addChild (). If I can get some help on how to do this, I would be so grateful that I spent many hours trying to cope with it. Thanks

+3
source share
2 answers

create a class (in the .as file) that extends UIComponentand using it as the root display object, add the createComplete creator to the constructor and use it as an entry point.
and therefore you only need the mxml code:

<?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>
+2
source

Recent versions of FlashBuilder allow you to directly create an ActionScript AIR project. If this is not your business, just create a new AIR MXML application, add a new actionscript class and set it as the default application. Then you can remove MXML. Also see this for details.

+1
source

All Articles