9 Replies Latest reply on May 29, 2008 2:48 AM by laurent_pinson

    How to open an image in popup window?

    Shelady Level 1
      HI,
      In my project there is some text and a small picture. I want when I click on this image a window appears with the full picture with only close option.
      ANy idea !!

      thanks
        • 1. Re: How to open an image in popup window?
          ntsiii Level 3
          mx:TitleWindow as a pop-up.
          Tracy
          • 2. Re: How to open an image in popup window?
            Shelady Level 1
            Here is my code. Plese tell me how to insert titleWindow here.

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
            <mx:HBox id="LowerLeft" width="30%" height="80%" borderStyle="solid" borderColor="#fffffc" borderThickness="2">
            <mx:TextArea height="300" width="288" horizontalScrollPolicy="off" verticalScrollPolicy="off" letterSpacing="1" backgroundAlpha="0" borderThickness="0" fontSize="12" fontFamily="Times New Roman" wordWrap="true" textAlign="left" backgroundColor="#869ca7" color="#ffffff">
            <mx:htmlText>
            <![CDATA[
            <p><img src='1.jpg' width='100' height='150' align='left' hspace='10' vspace='10'>This is cardiovascular medicine.translate the extraordinary progress of Promote heart health. At the nucleus of SCVI is a richl as it iscardiovascular medicine.</p><p>This is cardiovascular medicine.translate the extraordinary progress of science and rich thing.</p><p>Cardiovascular medicineThis is cardiovascular medicine.translate the extraordinary progress. </p>
            ]]>
            </mx:htmlText>
            </mx:TextArea>
            </mx:HBox>

            </mx:Application>
            • 3. Re: How to open an image in popup window?
              Gregory Lafrance Level 6
              I couldn't figure out how to click the image within the html and popup the full image, but the following is a possibility, though you would have to tweak it further.
              • 4. How to open an image in popup window?
                Shelady Level 1
                Hi,
                I think you forgot to attach the code. No problem. The worst is that I know how to do such thing in Dreamweaver CS4 beta. They have come up with this new spry option called tool tip where I can insert the picture and text and thats about it. I am sure that Flex has something too.

                P.S i can also try <mx:Image> too. All I need is to show smaller image on the front and if user need to see them full size and click on them then another window should open with full size image and with only close option.

                Thanks
                • 5. Re: How to open an image in popup window?
                  Gregory Lafrance Level 6
                  Oops. Sorry bout that... :-)

                  <?xml version="1.0" encoding="utf-8"?>
                  <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
                  <mx:HBox width="30%" height="80%" borderStyle="solid"
                  borderColor="#fffffc" borderThickness="2">
                  <mx:Image source="1.jpg" width="60" height="90"
                  click="navigateToURL(new URLRequest('1.jpg'),'_blank')"/>
                  <mx:TextArea height="300" width="288" horizontalScrollPolicy="off"
                  verticalScrollPolicy="off" letterSpacing="1" backgroundAlpha="0"
                  borderThickness="0" fontSize="12" fontFamily="Times New Roman"
                  wordWrap="true" textAlign="left" backgroundColor="#869ca7" color="#ffffff">
                  <mx:htmlText>
                  <![CDATA[
                  <p>This is cardiovascular medicine.translate the extraordinary progress of Promote heart health. At the nucleus of SCVI is a richl as it iscardiovascular medicine.</p><p>This is cardiovascular medicine.translate the extraordinary progress of science and rich thing.</p><p>Cardiovascular medicineThis is cardiovascular medicine.translate the extraordinary progress. </p>
                  ]]>
                  </mx:htmlText>
                  </mx:TextArea>
                  </mx:HBox>
                  </mx:Application>
                  • 6. Re: How to open an image in popup window?
                    Gregory Lafrance Level 6
                    Showing a smaller image and then the full image upon click, in perhaps its most basic form:

                    <?xml version="1.0" encoding="utf-8"?>
                    <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
                    <mx:Image source="1.jpg" width="60" height="90"
                    click="navigateToURL(new URLRequest('1.jpg'),'_blank')"/>
                    </mx:Application>
                    • 7. Re: How to open an image in popup window?
                      Shelady Level 1
                      Thats fine :)

                      appearently it is not doing what I want it to do. It is opening another window and showing the picture but the new window has all the explorer bars, menus etc. I dont want anythign but the picture and close option in that window.

                      <later on I will bring down the alpha of the big window to see some of the design from the base application>

                      But thank you so much for trying............again and again.
                      • 8. Re: How to open an image in popup window?
                        Kuldeep Atil
                        Hi, you can use ExternalInterface.call() method and set the parameters whichever you want. another way is that u can use PopUpManager.createPopUp() and use TitleWindow as the display object in which use the image tag for the image that u want.

                        Kuldeep Atil
                        kuldeepantil [at] gmail [dot] com
                        • 9. Re: How to open an image in popup window?
                          laurent_pinson Level 1
                          Use <mx:LunkButton> or mx.controls.LinkButton, it's a customizable button.

                          Here an example

                          Hoping that helps...
                          Laurent