5 Replies Latest reply on Apr 28, 2009 12:34 AM by CelineFR

    Air projects in Flex Builder3 are buggy

    nikos101 Level 2
      If I create a application as follows the air program runs fine:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()">
      <mx:Script>
      <![CDATA[

      import flash.display.NativeWindow;

      public function init():void{

      var options:NativeWindowInitOptions = new NativeWindowInitOptions();
      options.systemChrome = NativeWindowSystemChrome.STANDARD;
      options.type = NativeWindowType.UTILITY
      options.transparent = false;
      options.resizable = false;
      options.maximizable = false;



      var mainWindow:NativeWindow = this.stage.nativeWindow;
      //mainWindow.maximize();
      mainWindow.activate();

      //var newWindow:NativeWindow = new NativeWindow(options);


      }
      ]]>
      </mx:Script>
      </mx:WindowedApplication>


      However when I uncommented out

      //var newWindow:NativeWindow = new NativeWindow(options);

      the application did not run.

      when I recommeneded the line

      var newWindow:NativeWindow = new NativeWindow(options);

      the application did not run again. Indeed now the mxml file was broke and no changes caused the program to run.

      The only thing I could do was create a new mxml file and then the new air program would run each time for a while.

      Can anyone shed some light on this?

        • 1. Re: Air projects in Flex Builder3 are buggy
          anirudhs Level 2
          Hi nikos,

          I tried out your code and uncommented the var newwindow line and it worked without any problems.

          Try cleaning your project and forcing a re-build. Also, try hitting debug in flex builder (not run). When you hit run and if a misbehaving AIR application was already launched, your current application will not be launched.

          Just check to see if adl.exe is in the process list and end task it. Then your app will launch.
          • 2. Re: Air projects in Flex Builder3 are buggy
            CelineFR

            Hi,

             

            I am new in flex application and i have created a browser based application but i need in my application creating a folder and save it on my computer, this can't be possible with browser based application, so i want to test an air application to do this but i don't know how to create an air application with Flex Builder, may i install something other or configure flex builder???

             

            Thanks,

            Celine

            • 3. Re: Air projects in Flex Builder3 are buggy
              CelineFR Level 1

              Hi, i have tried  to creeate an air project with flex Builder just for testing the creation of a folder, like this

               

              <?xml version="1.0" encoding="utf-8"?>
              <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
                   import flash.filesystem.*;

               

              var source:File = File.desktopDirectory.resolvePath("test.txt");
              var target:File = File.documentsDirectory.resolvePath("AIR Test/test.txt");
              var targetParent:File = target.parent;
              targetParent.createDirectory();
              source.moveTo(target, true);
              </mx:WindowedApplication>

               

              and it give me this error, some one have an idea?

               


              Parse error at '\n\timport flash.filesystem.*;\n\nvar source:File = File.desktopDirectory.resolvePath(\"test.txt\");\nvar target:File = File.documentsDirectory.resolvePath(\"AIR Test/test.txt\");\nvar targetParent:File = target.parent;\ntargetParent.createDirectory();\nsource.moveTo(target, true);\n'.

               

              thanks,

               

              Celine

              • 4. Re: Air projects in Flex Builder3 are buggy
                Jeff Swartz Level 3

                Celine, try the following:

                 

                <?xml version="1.0" encoding="utf-8"?>
                <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" applicationComplete="init()">
                <mx:Script>
                    <![CDATA[
                    import flash.filesystem.*;


                    public function init():void
                    {
                        var source:File = File.desktopDirectory.resolvePath("test.txt");
                        var target:File = File.documentsDirectory.resolvePath("AIR Test/test.txt");
                       

                        // These lines are not needed:
                        // var targetParent:File = target.parent;
                        // targetParent.createDirectory();
                       

                        source.moveTo(target, true);   
                        trace(target.nativePath);   
                    }
                    ]]>
                </mx:Script>

                </mx:WindowedApplication>

                • 5. Re: Air projects in Flex Builder3 are buggy
                  CelineFR Level 1

                  Thanks Jeff, i have found the same solution here:

                  http://www.insideria.com/2008/03/beginning-air-accessing-the-fi.html

                   

                  Sincerly,

                   

                  Celine