4 Replies Latest reply on Sep 15, 2010 3:45 AM by blacksyforce

    Hide application in taskbar, appear like a widget

    DanielMaceira

      Please! Help Me!

       

      In a new Project of Adobe Flex/Air, I get error 1136.
      This occurs when I add a new mxml file, with the code:

       

      <mx:Window xmlns="http://ns.adobe.com/air/application/1.5"
                 xmlns:fx="http://ns.adobe.com/mxml/2009"
                  xmlns:mx="library://ns.adobe.com/flex/mx"
                  width="200" height="100"
                 transparent="true" systemChrome="none" type="normal"
                 showStatusBar="false" showTitleBar="false" showFlexChrome="false">
          <mx:Label text="New Window"/> 
      </mx:Window>

       

      This give me the error:
      1136: Incorrect number of arguments.  Expected 1.

       

      There´s nothing else in the project.

       

      I need to start the appliction without icon on taskbar, like a widget.

      And I´ll use this mx:Window to open that like a new windows without appear in taskbar. I saw that in a tutorial, that don´t work!

       

      Can you help me?

        • 1. Re: Hide application in taskbar, appear like a widget
          blacksyforce
          Sample code from an older app of mine. See if u can get anything good from it...
          stage.nativeWindow.close();
          var options:NativeWindowInitOptions = new NativeWindowInitOptions();
          options.type = NativeWindowType.UTILITY;
          options.systemChrome = NativeWindowSystemChrome.NONE;
          options.transparent = true;
          var window:NativeWindow = new NativeWindow(options);
          window.stage.align = "TL";
          window.stage.scaleMode = "noScale";
          window.activate();
          • 2. Re: Hide application in taskbar, appear like a widget
            DanielMaceira Level 1

            Hi!! Thanks blacksyforce !

             

            I would like that I can open a MXML in a new window, but I got the error mentioned.

             

            Now I´m creating this window programing that.
            After I got the user e-mail in a mx:panel, I call a function that should open the new window.
            I´m using this code:

             

            private function OpenWindow(email:String):void{
                            var swfLoad:SWFLoader = new SWFLoader();
                            swfLoad.source = "assets/movie.swf";
                            swfLoad.width = 220;
                             swfLoad.height = 400;
                           
                            var win:Window = new Window();
                            win.width = 230;
                            win.height = 410;
                            win.transparent = true;
                             win.showTitleBar = false;
                            win.showStatusBar = false;
                            win.resizable = false;
                            win.type = NativeWindowType.LIGHTWEIGHT;
                            win.systemChrome = NativeWindowSystemChrome.NONE;
                             win.addChild(swfLoad);
                            win.open(true);
                           
                            arvore = win.getChildAt(0) as MovieClip;
                            arvore.setTextFromFlex("my@email.com.br");
                            
                            childApp.visible=false; //this don´t work

             

                        }

             

            But I can´t close the main windows. The app item in Windows taskbar, remains there.
            I need to hide the app item in the taskbar, remains that new window on desktop and add a systray icon.

            If someone know something...

             

            Thanks!!

            • 3. Re: Hide application in taskbar, appear like a widget
              DanielMaceira Level 1

              I tried:

               

              var window:NativeWindow = new NativeWindow(options);

               

              but I couldn´t load the SWF inside that, I got another error.

              tks!

              • 4. Re: Hide application in taskbar, appear like a widget
                blacksyforce Level 1

                I copy/pasted your code and replaced

                 

                arvore = win.getChildAt(0) as MovieClip;
                arvore.setTextFromFlex("my@email.com.br");
                                
                childApp.visible=false; //this don´t work

                 

                with

                 

                stage.nativeWindow.close();

                 

                or

                 

                stage.nativeWindow.visible = false;

                 

                and it works for me.