Read Full Documentation >>
Photo & video gallery
By: Jorge Solis
An MVC Photogallery (YAP ... yet another photo gallery)
Icons and single view
Columns view
------------------------------------------------------------------------------------------------------------------------------
Important: since my english is not really god and we don't have an editorial
reviewer in Flash-db (we simply write tutorials in our free time) I apologize
in advance for the grammatical and spelling errors you can find in this tutorial.
Please let me know about it on Boards
and I will do my best to fix it
------------------------------------------------------------------------------------------------------------------------------
Some time ago, the company where I work needs a photo gallery for a photo aid. The client is a mobile phone company, so people take photos using a cellular phone and send trough email. Tons of photos comes to our server daily, and some way of automatic handling it was a must. This was the beginning of this photo gallery. The success of the aid encourage the company to begin others aids (for Vip clients, for young clients, "send your photo dancing", and so on ...) , so we need to use some mechanism that could change the way we show images and the way the application looks for data (sometimes just the file system, others a database or an XML file) This was the beginning of the rewriting of this little application using a more reusable code. Honestly, the short deadlines forces me to just use a collection of functions, but when the heat of the fight finished, I rewrited completely the code.
This is an attempt to write a simple application using some well-known pattern, formerly Model-View-Controller. Some years ago, when I saw by first time this topic (in the excellent book, "Object-Oriented Programming with ActionScript " from Branden Hall and Samuel Wang, New Riders) the only conclusion was: this is much more difficult to write, make sense? At the time, the kind of projects I was working for, gives me a conclusion ... guess what?
Writing some introduction to OOP patterns is far away from my goals (and my knowledge) but probably, if you never have heard about this, modifying this application or reading the tutorial is not a good place to start, since it assumes you have a good knowledge of AS plus some familiarity with OOP patterns. For those interested to begin with OOP, I recommend "Essential actionscript 2.0" from Coolin Moock.
The kind of Flash applications using patterns that we can see on Books or tutorials are really simple, and since they show the basic way of implementing it, they really don't pay the price of using such a complex way (NoteTaker from Branden Hall or the MVC clock from Coolin Moock among others) The full benefits of implementing such architecture is when complexity arises and applications are large, but how to write an enough complex application in a book whitout be "obscure"? (or at least difficult to be read) That makes sense if you need to sell books. And the same happens here, the code is a little complex for such a simple application, but since I don't need to sell anything, I don't care.
The point on this was: could a pattern helps development when changes to the interface and data source is constant? I will try to answer this on next pages. Prior to continue reading, download the example files. Note that the only fla file have different include commented on timeline. All the code is external, and based on which one you include you will publish one or another version (read comments in fla). Take a look at the readme file, and if you use the SQLLite example, remember that you need PHP 5 in order to run it.
NOTE: Due to the large size of videos and images used in the gallery, the source files size have 8,8 MB

5 most recent
Tree menu
Flash Spell Checker
Flash Remoting Library
MX 2004 Chart/Poll
Applications
Download
the Source Files