Thursday, January 20, 2005
I recently posted about a little Flash Video solution I built using PHPObject, I have decided to post the code for how I did it. First of all I built a service to open my flv directory and read the files. This consisted of a modified version of the PHP.net code example of how to read the contents of a directory. Basically it opens my '/flv' directory puts all the filenames into an array and then returns the array to Flash.
Now here is the actionscript used to tie it all together:
Let me explain what is happening here. First I import the PHPObject.as file set up the secret key and gateway links as per normal. Next I set up a new PHPObject which looks for a service called "myvideos", this contains the php code in the first example above. The following line sets up a responder function for the function getflvlist(), inside this responder I set the data provider of a comboBox component to an array which has been populated using a for loop with the contents of result (result being the array returned from m PHP service). Then I call the service function to populate the comboBox.
The next section simply sets up a listener object to, on change, concatenate a base URL with the filename which was returned by my PHP service and set as the value for the comboBox entries an then simply tell the media player component to play the file.
Now I just drop my FLV files in the flv directory and the comboBox instantly updates and is selectable.
Jon 9:08 PM Permalink
Last year was definitely the year of iPod so when my girlfriend Kate & I decided to throw a Christmas cocktail party Kate asked me to design an invite and I couldn't resist ripping off the Apple ad with a Flash invite.
Here is the result.
Jon 8:59 PM Permalink
Tuesday, January 04, 2005
Happy New Year everyone I wanted my first post of the year to be a bit more useful than normal so I have put together a quick photoshop tip for anyone wishing to create icons.I had a conversation with Dan Cederholmfrom SimpleBits a while ago about Icon creation and told him about a very cool little thing you can do with Photoshop to make the process easier, I had assumed that this was common knowledge but as it isn't I thought it would be a good article for freaksauce, so here we go.
When creating an Icon you need to be zoomed in as far as you can go but how annoying is it to have to zoom out everytime you want to check your work? Well you don't have to, just follow these simple steps. First create a new document, say 40px square.
Now the clever part go to Window>Arrange>New Window for xxx.psd (thanks for Albert Hardy for pointing out that this is specific to Photoshop CS, for earlier versions use Windows>Documents>New Window)

Now you have an exact duplicate of your document as below:
Now simply select one of the documents and zoom in to 1600%.
Now as you work in the large window the changes are reflected in the small window so you can check your work in realtime, easy!

UPDATE:
I have had someone point out in my comments that I haven't explained what the next steps are to creating icons. Well, I usually create icons for web applications and Flash applications so no conversions have ever been necessary but I have on occasion needed to create a Favicon or two at which point you will need to convert your file to a '.ico' file. To do this you will need to use something like Icon Builder Pro or try checking this list of freeware and shareware Windows Icon utilities. If you are an OS X user this article on creating Favicons should point you in the right direction.
If anyone knows of any other tips or software regarding this article please leave a comment and I will include the information in the original post.
Jon 7:56 PM Permalink
