Loading image into flash through php

Hello, I have a question (surprise :-)). My goal is to load images from a directory on my webserver into flash. The problem is that I want the images folder to be protected by .htaccess that prevents direct access to that folder, and therefore I cannot directly load the image into flash by URL. My thought is that I need to use an intermediary, php, to direct the image request to the server-side script so that it will return an image to me; the php would be able to access the images because it is going to be an internal operation rather than cross domain direct request. The question is how do I request an image from php and load it into flash; the name of the desired picture is, of course, known from a database.

         Thanks ahead.

                    sequence.

Hey Hans, it worked very nicely, thanks. I am wondering whether it is possible to do this vice versa; can flash send image object to php so it can then convert it to image file and save on server? Or must I use file form in html to upload pictures?

                  Thanks ahead.

                        Sequence.