-
importing pictures using code?
Hi,
This is my first post on the forum, and i couldn't find out where to put this question.
ok so here goes...
what i am aiming to do is to create a gallery for some photos, to put on someones website so that they can show their art work, and they will be adding and removing pictures from time to time, now instead of them having to email/ring me all the time to change a few pictures, i was wondering.... is there a way of having some Actionscript either 2.0/3.0 that will be able to scan folder, see how many pictures are in there, and display one after the other in a "gallery" so that the user can FTP the new pictures into this folder, and take some away without having to change the flash at all?
i dont know if this is even possible, i am just wondering.
if anyone needs any more info about it, i am happy to explain again, as im sure the previous might not make much sense, but im not sure how else to say it.
cheers,
Bunker
-
Prid - Outing
You can make an XML file to store the path to the images, and also their names, and other stuff. Then, you can pull the data from the XML file in Flash, and change the content in your XML file when wanting to change picture
If you find this solution suitable for your needs, I can explain further if you want
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
An alternative to Nig_13's solution is using the flash.filesystem.File class. It's designed just for the purpose of manipulating files and directories. I personally like this better than an XML file because I wouldn't need to write an XML file. Even if I were to generate that file through code, I would still need to use a file and directory feature such as that of PHP, so why wouldn't I just use the one that came with Flash?
The downside with the File class I think is that I would only be able to display the image and the name of the file. So if I displayed an image called mynewhome.jpg, it would be called mynewhome and I won't be able to name it My New Home because the program just won't know. That's where the XML file has an advantage over this. More work for more detail.
-
Except of course that the flash.filesystem.File class is only available in AIR, and as such, won't work on a web site.
As said above, if you wanted a description or other information than just the image, XML is a good way to go. If all you want is the image, you'd be best off using a server side language like .NET or PHP to read the images in the directory and pass them to Flash.
Here's one tutorial I found for PHP, getting it to read the files would be the first step. Then you'd need that info passed to Flash, either on load through FlashVars or called via ActionScript.
http://www.iguides.org/forums/develo...older-php.html
-
thanks for the replies guys, i thought i new abit of AS but trying to work out how to do this i have no idea haha, i now asp.net, better than i know PHP, so didnt know if anyone out there can give me a headstart, and sort of a mini tutorial on how to do it, without giving me a lot of code as i like to learn new code myself and i dont want you guys to think i want you to write it all for me as thats not fair,
Thanks,
Bunker
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|