Archive for March, 2008

Planning For Development

Posted by mike@sd-dezign on Mar 26 2008 | General

Never try to launch a rocket without fuel.

I’ve been testing (with a mild level of success) whether there are easier ways to handle external data in Flash.  Each person’s situation is different and completely dependent on the resources they have available to them but what if such a method existed?

The best solutions for handling data in Flash all come down to the amount of work put in at the planning stages of a project.  For instance, when I began my Flash IMS (Image Management System), one of the first classes I wrote was a file handling class.  In the early stages, I was positively sure that I would be using this class repeatedly to get all of my image data into Flash.  Turns out…I was WAY wrong.

After sitting down and building out a rough draft of the database structure (in mySQL), I realized that most of the functions which originally encompassed the SD_FileHandler class weren’t necessary at all and after clean-up I was left with one solitary function.  The functions only responsibility is to crawl through a directory looking for a specific image type (the default is jpg) and is only used by the admins to administer the site.  I ended up writing an entire second class that pulled content per the area of the site it was needed and even this class doesn’t use the SD_FileHandler class or its solitar function “fileFilesOfType”.

function findFilesOfType($dir, $type=’.jpg’){
  $jpgs = array();
 
  $dirHand = opendir(SD_BASE_PATH . SD_CUSTOMER_URL . $dir . “/” . SD_PCIMAGES_DIR);
  while($file = readdir($dirHand)){
   if(substr(strtolower($file), -4) == $type)
   {
    $jpgs[] = $file;
   }
  }
  
  sort($jpgs);
  
  return $jpgs;
 }

Because my final approach to handling the data was a mySQL database, there really aren’t any files which require php file handling at this level so my original class is really quite defunct.  In the final System, Flash simply calls a PHP file which in turn calls the IMS classes and loads the data specific to the situation.  Ironic if you ask me.

The point is this, whenever you start a project, always make the extra effort during the planning stages.  It will prevent more headaches than it will cause, hours of debugging and in the end, provides a clean, simple approach to handling the task at hand.

no comments for now

New Contact Info

Posted by mike@sd-dezign on Mar 25 2008 | General

Hey everyone.  I decided since I’m mobile, to provide a means for everyone to reach me.  I now have Google’s IM service on my Blackberry.  If you have questions or comments and have Google IM, send a message to sddmike@gmail.com (note, you can also e-mail me at this address).

no comments for now

Life In Texas & The Flash IMS

Posted by mike@sd-dezign on Mar 23 2008 | AS3, Flash, General, PHP

All very good!  Tiring…but definitely good.  I’ve updated the site again and gone back to a simple blog system again.  I found I simply don’t have enough time for much more than a blurb here and a blurb there.

When I’m not busy at work, I’m busy at home building an IMS (Image Management System).  The principles behind it are very similar to those of a CMS but I’ve added an interesting little twist…

I’ve always been in pursuit of a truly dynamic way to handle image content in Flash.  Traditional methods require that you push content into Flash from text files or XML files.  For the traditional developers and site managers out there, this isn’t much of an issue. 

Let’s say however that a client wants/needs to be able to edit image content inside their Flash site and your client isn’t HTML saavy or have staff on site who can manage the content for them once the site is complete.  What then?  I have recently run into this problem.

The past 5 years, I worked for a small photography studio in a Chicago suburb.  Late last year, I moved to Texas.  Prior to the move, a website change only required a call down to my office (in the crypt…j/k) and I would be able to update the site in minutes.  Now that I am in Texas, when a site change is required, it often entails conference calls, e-mail correspondence and attachments and because I work 100 miles away from home and my labtop, it is almost always hours before I can make any physical change for them.

My solution was to create an OO CMS/IMS coded completely in PHP5 that would run from a MySQL database and give them the ability to change the content inside their site (completely Flash based) without needing to call me for the “simple” stuff.  What I’ve was able to achieve was a uniquely simple admin panel that gives them the ability to edit not only their text based content but also their image content on the fly in the easiest way possible.

Now, instead of Flash having to make a ridiculous number of URLRequests for each image, remembering the entire site structure etc, I’m able to use a single URLRequest inside a custom AS3 Class to bring an array of mySQL stored and PHP generated data back into Flash.  The result was a cleaner, simpler method for handling and controlling what data Flash would recieve and when.

As a result, I’ve also been able to make subtle, appealing visual changes that simply weren’t possible before because of all the content that needed to be stored to render out each menu, gallery or text blurb that were already hammering the system to its peaks.  For instance, the senior menu which contains 7 different galleries, 150+ images (plus their thumbnails) and over 30 plus text blurbs, couldn’t afford much in the way of visual stimuli prior to removing all of these calls and classes from Flash that are responsible for displaying thumbnails, cycling timers, etc.

I’m putting the finishing touches on the system now and plan to bring it online by mid-April when I update the Fedler Studio site.  Once the site goes live, I’ll be back to posting on my blog on a regular basis and hopefully providing insight into what I did as well as the lessons I learned.

Later!

no comments for now