6 Replies Latest reply on Nov 5, 2007 6:29 AM by Karl_Sigiscar_1971

    popup HTML window need?

    mark416 Level 1
      Hi,

      I want to build a link in Flex. A HTML popup page come up when I click the link.

      Please give me a idea how to do this.

      Thanks

      M
        • 1. Re: popup HTML window need?
          atta707 Level 2
          look at the ExternaInterface example in Flex Builder help. Write a javascript function to pop open the HTML window and call that javascript function from flex using ExternalInterafce class methods.

          ATTA
          • 2. Re: popup HTML window need?
            mark416 Level 1
            Where the example located? I am new for Flex,sorry for asking so simple question.

            Thanks

            Mark
            • 3. Re: popup HTML window need?
              mark416 Level 1
              Hi,

              I find this one for generating a Flex popup

              <?xml version="1.0"?>
              <!-- containers\layouts\MyPopUpButton.mxml -->
              <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
              height="600" width="600" >

              <mx:Script>
              <![CDATA[
              import mx.containers.TitleWindow;
              import flash.events.*;
              import mx.managers.PopUpManager;
              import mx.controls.Button;
              import mx.core.IFlexDisplayObject;

              // The variable for the TitleWindow container
              public var myTitleWindow:TitleWindow = new TitleWindow();

              // Method to instantiate and display a TitleWindow container.
              // This is the initial Button control's click event handler.
              public function openWindow(event:MouseEvent):void {
              // Set the TitleWindow container properties.
              myTitleWindow = new TitleWindow();
              myTitleWindow.title = "My Window Title";
              myTitleWindow.width= 220;
              myTitleWindow.height= 150;
              // Call the method to add the Button control to the
              // TitleWindow container.
              populateWindow();
              // Use the PopUpManager to display the TitleWindow container.
              PopUpManager.addPopUp(myTitleWindow, this, true);
              }

              // The method to create and add the Button child control to the
              // TitleWindow container.
              public function populateWindow():void {
              var btn1:Button = new Button();
              btn1.label="close";
              btn1.addEventListener(MouseEvent.CLICK, closeTitleWindow);
              myTitleWindow.addChild(btn1);
              }

              // The method to close the TitleWindow container.
              public function closeTitleWindow(event:MouseEvent):void {
              PopUpManager.removePopUp(event.currentTarget.parent);
              }
              ]]>
              </mx:Script>
              <mx:Button label="Open Window" click="openWindow(event);"/>
              </mx:Application>


              But I l already have the html file and I need a HTML page popup.Thanks

              M
              • 4. Re: popup HTML window need?
                ntsiii Level 3
                That is a Flex pop-up, you want an HTML popup in a separate browser, right?

                See this link ( found using google, which you can do yourself):

                http://blog.flexexamples.com/2007/08/29/launching-new-browser-windows-from-flex/

                Tracy
                • 5. Re: popup HTML window need?
                  mark416 Level 1
                  Hi

                  I want to know if navigateToURL can defien popup windows size?

                  Thanks

                  M
                  • 6. Re: popup HTML window need?
                    Karl_Sigiscar_1971 Level 3

                    Use navigateToURL("javascript:window.open ('www.mysite.com', '', 'menubar=1,resizable=1,width=350,height=250')");