2 Replies Latest reply on Aug 13, 2010 7:46 AM by dougieweb

    PopUp Manager and Flex Forum PopUps

    dougieweb

      I wanted make sure I understood what someone on the Forum told me about the PopUpManager and TitleWindow.

       

      My question was:  "How are the PopUps that appear when you hover over a person's image/profile on the left side of this Adobe Forum's page done?  Did you use Flex for this, or are they some type of Ajax thing?  If Flex was used was it done with the PopUp Manager based on the TitleWindow.  This is exactly the kind of PopUp I need, especially because it has a larger hit area than most PopUps which dissapear when the mouse exits the button or textarea acting as a button.

       

      Thanks and Sorry for the long version.

       

      Doug

        • 1. Re: PopUp Manager and Flex Forum PopUps
          ShardulSingh Level 3

          Hi,

          Same  thing is simple to acheive in flex.You can try the code below.Let me know if you have any issue with this.

           

           

           

          MainApplication.mxml

           

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
               verticalAlign="middle">
              <mx:Script>
                  <![CDATA[
                      import mx.managers.PopUpManager;
                      private var bool : Boolean;
                      private var myPopUp:MyPopup;
                     
                      private function onMouseOver():void
                      {
                          if(bool == false)
                          {
                              if(myPopUp != null)
                              {
                                  PopUpManager.removePopUp(myPopUp);
                                  myPopUp = null;
                              }
                              myPopUp = MyPopup(PopUpManager.createPopUp(this, MyPopup, false));
                              myPopUp.move(700,400);
                             
                              var infoObject : Object = new Object();
                              infoObject.imagePath = 'assets/img1.png';
                              infoObject.name = "David";
                              infoObject.country = "United Kingdom";
                              infoObject.profession = "Software Developer"
                              infoObject.domain = "Banking";
                             
                              myPopUp.info = infoObject;
                             
                              bool = true;   
                          }   
                      }
                     
                      private function onMouseOut():void
                      {
                          bool = false;
                          if(myPopUp != null)
                          {
                              PopUpManager.removePopUp(myPopUp);
                          }   
                      }
                  ]]>
              </mx:Script>
              <mx:Image source="assets/img1.png" mouseOver="onMouseOver()" mouseOut="onMouseOut()"/>
              
          </mx:Application>

           

           

           

           

           

          MyPopup.mxml

           

          <?xml version="1.0" encoding="utf-8"?>
          <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" width="250" height="300"
              title="Author Information">
          <mx:Script>
              <![CDATA[
                  private var _info:Object;

           

                  public function get info():Object
                  {
                      return _info;
                  }

           

                  public function set info(value:Object):void
                  {
                      _info = value;
                      if(value != null)
                      {
                          imgImage.source = info.imagePath;
                          nameLbl.text = info.name;
                          countryLbl.text = info.country;
                          professionLbl.text = info.profession;
                          domainLbl.text = info.domain;
                      }
                  }
              ]]>
          </mx:Script>
              <mx:VBox width="100%" height="100%" horizontalAlign="center" verticalAlign="middle">
                  <mx:Image id="imgImage" buttonMode="true" useHandCursor="true"/>
                  <mx:Label id="nameLbl"/>
                  <mx:Label id="countryLbl"/>
                  <mx:Label id="professionLbl"/>
                  <mx:Label id="domainLbl"/>
                     
              </mx:VBox>
                  
          </mx:TitleWindow>

           

           

           

           

           

          with Regards,

           

          Shardul Singh Bartwal

          1 person found this helpful
          • 2. Re: PopUp Manager and Flex Forum PopUps
            dougieweb Level 1

            Hey Shardul,

            I like this and appreciate it very much - this will be helpful.  However, the "popups" in the Flash Forum are interactive and they do not dissapear after rolling the mouse off of the original object.  I really need the popup to stay open, offer text and "buttons" as well.  The hit area needs to be the original event, plus the popus itself I suppose.

             

            Thanks for you help.

            Doug