4 Replies Latest reply on Oct 15, 2009 6:49 PM by RedOctober57

    Show a "modal" window

    RedOctober57 Level 1

      In FB4 I have a list of records in a DataGrid.  The DataGrid only shows the description of the record, not all the fields in the record.  I currently have the double click event of the DataGrid programmed to show an Alert.show().  In the alert, processing is stopped until the user does something with the alert.  Like, cancel it or click OK, or some such.  I will be making another mxml file that contains all the fields in the Image record (A detail form), including an image component to show the image.  I have some questions...


      How can I call the "Image Record Detail" "page" (like an "ordinary" link) from the page that contains the DataGrid (the main page) from within the ActionScript itemDoubleClick event?  (The detail page will be a form, if that's of any help)

      How can I call the "Image Record Detail" page, in a "modal" way (which will stop program flow until the user has done what ever they want with the detail page)?  (I don't want the user to be able to click on the main page until they click "Commit" or "Undo" or "Done" in the detail page.


      How do I load an image into the detail page?  ( I know the Unique Identifier for the record, so, I guess I could make a call to the ColdFusion layer, but how do I get the image on the disk of the server?  I can certainly store file locations in Windows folders, (like C:\baa\img\1...etc.) but what if my app isn't running on MS Windows (some OSs don't use drive letters, right)?  Is there a "universal" way of navigating a folder structure on disk, in CF that I can use to send an image back to the FB4 layer, that is sure to work on all OSs?  And besides, how does one pass an image file from CF9 to FB4 anyway? The return types of the CF9 functions (shown in FB4 "return data type" are only simple types like string and integer and date)


      Thanks in advance.

        • 1. Re: Show a "modal" window
          Gregory Lafrance Level 6

          For displaying the Image Record Deatil in a modal window create a popup and pass the "modal" argument as true:




          That example uses TitleWindow, but you could use Form, etc. instead.


          As far as the images go, you can embed using the Embed directive, or have network paths to the images on the server like http://www.myCompany.com/flex/myapp/images/myImage1.png


          If this post answers your question or helps, please mark it as such.

          1 person found this helpful
          • 2. Re: Show a "modal" window
            RedOctober57 Level 1

            Hi Greg, thanks for the pop-up answer.  I should have marked it as "Answered" but I clicked the "Helpful" instead.  If you respond to this message I'll be sure to mark it answered.  So,  I should have mentioned that the images are in no way for public consumption.  They must be shown only to people logged into the site.  Using Http:// addresses would mean (I think) that the images could be accessed by FB4, but also, anyone on the Internet, if they were to purposely or accidentally point their browser URL to the image folder or an actual image file.  Is that correct?


            I need a way to keep all images private and secure, yet show them only to logged in users.  How do I do that?


            Oh ya, there will be at a minimum, 135,000 of them, so I'm thinking that embedding them is probably not the answer as I'm assuming that means that they would become part of my .swf.  (Is that true?)


            Thanks in advance Greg.

            • 3. Re: Show a "modal" window
              RedOctober57 Level 1

              I guess what would go a long way to answering my question about loading/displaying images in FB4 using CF9 as an intermediary is...


              Is there a CF Function that I can "hand" an image location to, and have it "hand back" the image data, that Flash Builder 4 can then render on screen.  I'd need code snipets of both the CF Function and tha ActionScript function ... and perhaps the FlashBuilder 4 object/class that I should be using to show the image.  I imagine it would look something like...


              <cffunction name="getImage">

                <argument name="fileName" type="string">

                <cfset MyImage="">


                 returns MyImage;



              private LoadImage (imageobject, MyCF9DataSource, ImagefilePathAndName)






              Of course this is just my own crude imaginings.  I need help to shoe me the real code that does this.

              I can find examples about CF9 and image handling, but I can't find an example of FB4 retrieving an image from CF9 and loading it into an image component for display.