Flex 2 SDK on OpenBSD 4.1

Posted by face on October 15, 2007

Java is a prerequisite. I tried building a simple mxml file with kaffe on OpenBSD, but kaffe failed with a CDATA error for flex 2 and then simply dumped core flex 3 beta. So before we start, lets build and install JDK for OpenBSD from source. Once you have built jdk-1.5, install it and ensure $JAVA_HOME is set and $JAVA_HOME/bin is on your path.

If you don’t already have wget and unzip installed, we can install them now:

sudo csh
setenv PKG_PATH ftp://ftp2.usa.openbsd.org/pub/OpenBSD/4.1/packages/i386
pkg_add wget unzip

The flex sdk is free and comes in a multi-platform binary format. Adobe forgot to put it in a directory, so lets make one for it now and then grab and unzip the sdk:

sudo mkdir /usr/local/flex2sdk-2.01
sudo ln -s /usr/local/flex2sdk-2.01 /usr/local/flex
cd /tmp
wget http://download.macromedia.com/pub/flex/sdk/flex2_sdk_hf1.zip
cd /usr/local/flex
sudo unzip /tmp/flex2_sdk_hf1.zip
rm -f  /tmp/flex2_sdk_hf1.zip
sudo chmod +x /usr/local/flex/bin/mxml

That should do it. Lets try it out. Place the following in a file called hello.mxml:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="center" verticalAlign="center">
  <mx:Panel title="Yo">
    <mx:Text htmlText="Hello &lt;b&gt;new&lt;/b&gt; World!" />

And now compile it:

/usr/local/flex/bin/mxmlc hello.mxml

And you should end up with hello.swf:

Digg! Delicious! Technorati Blinklist Furl Reddit

How to create and add favorite icons to your website (favicon.ico)

Posted by face on October 13, 2007

1. Introduction

You may have noticed that firefox as well as IE 5 and higher have support for icons associated with URLs. These icons are displayed in the address bar of firefox as well as along side bookmarks/favorites in firefox as well as IE.

If you don't have a /favicon.ico installed on your site you will something similar to the following errors in your apache error_log file:

[error] [client X.X.X.X] File does not exist: /htdocs/favicon.ico

Using png2ico is an intuitive way to create a single favicon.ico file containing the web standard 16x16 and 32x32 resolutions. This Guide focuses on using png2ico along with The GIMP.

The GIMP 2.X supports "Save As" .ico natively. I could not find an easy way to edit and place both resolution icons in one file. So if you only want a single 16x16 favicon.ico, just use GIMP2. However, If you want two resolutions in your .ico...continue following this guide.

Digg! Delicious! Technorati Blinklist Furl Reddit