3 Replies Latest reply on Jun 17, 2008 9:42 PM by slaingod

    Text input popup

    HisWacko
      I am writing a simple RSS reader app in Flex (for AIR).

      I have a "change feed" button in my app. I want this to launch a popup with text input, to take the URL as a string and return it to my main app. This seems like something that should be incredibly, and I'm missing something. Any help would be apreciated.
        • 1. Re: Text input popup
          Gregory Lafrance Level 6
          You can create such a popup with a TitleWindow and PopupManager:

          ------------ MyPopup.mxml ----------------
          <?xml version="1.0"?>
          <mx:TitleWindow xmlns:mx=" http://www.adobe.com/2006/mxml">
          <mx:Script>
          <![CDATA[
          import mx.managers.PopUpManager;
          ]]>
          </mx:Script>
          <mx:TextInput width="200" />
          <mx:Button label="Done"
          click="PopUpManager.removePopUp(this);"/>
          </mx:TitleWindow>
          --------------------- Test.mxml ----------------------
          <?xml version="1.0"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
          <mx:Script>
          <![CDATA[
          import mx.managers.PopUpManager;
          import mx.core.IFlexDisplayObject;
          import components.MyPopup;

          private function showMyPopup():void {
          var helpWindow:IFlexDisplayObject =
          PopUpManager.createPopUp(this, MyPopup, false);
          }
          ]]>
          </mx:Script>
          <mx:Button click="showMyPopup();" label="Show My Popup"/>
          </mx:Application>
          • 2. Re: Text input popup
            HisWacko Level 1
            That gives me a popup, but how do I return that string to my main? or is it there and i just don't see it?
            • 3. Re: Text input popup
              slaingod Level 1
              You can return it with a custom event, or Application.application..., or using interfaces, etc. Ie. the way a normal popup lets you find out if CANCEL or OK, or whatever was pressed is by returning a CloseEvent.