Welcome to jimhalliday.net!

Welcome to jimhalliday.net, my little piece of the web. Browse the links to the left to get to the good stuff. Enjoy!

Universal Integer Reader/Writer

There are a wide variety of ways to read and write integers to a file. This code fragment enhances Java's RandomAccessFile to encompass a wider variety of methods, including 1, 2 and 4 byte integers, and both signed and unsigned values.

Flex Demo 8 - Streaming External Sound

View Flex Demo 8

This sample demonstrates streaming an external sound file from within a Flex application.



Show a number in hex form

In Java, the 'toHexString' method will convert a number into a string that represents that number in hex form. However, this string is not usually formatted in the way that most people would expect - it does not begin with '0x' and does not contain leading zeros. Here is a function that does just that.

Flex Demo 7 - Playing Embedded Sound

View Flex Demo 7

This sample demonstrates the ability to play sound samples that are embedded within the swf file itself. Embedding the sound file within the swf should usually be used when the sounds are relatively small and short, or they need to be loaded quickly.

Flex Demo 6 - Simple Transitions

View Flex Demo 6

This demo is very similar to Demo 5, but we have added a simple transition between each screen.

Flex Demo 5 - View Stack and Handling Keystrokes

View Flex Demo 5

This demo addresses using a ViewStack and handling keystrokes. In this case, we handle keystrokes on a application-wide basis.

Flex Demo 4 - Using Bindable Variables

View Flex Demo 4

This demostrates using the 'Bindable' keyword and overwriting default values for an object.

Flex Demo 3 - Load Images at Runtime

View Flex Demo 3

This sample demonstrates a simple image display application.

Display a reasonable indicator of file size

By default, a Java indicator of file size will tell you the number of bytes, but of course a number such as 1042354 isn't exactly user-friendly. Here's a small method to return a human-readable string indication of a number of bytes.

Flex Demo 2 - Basic Interaction

View Flex Demo 2

This program demonstrates a very basic interaction -- a listener for a button.

Flex Demo 1 - Basic Spark Components

View Flex Demo 1

This program demonstrates just how little code is needed to create a fully working Flex application! Of course, the components don't really do anything, but at least they are displaying. The following code is all that is needed to create this application:

Making a JLabel with selectable text

A Java JLabel works pretty well, but anyone who has used them is well aware that the user cannot select the text inside of them for copying and pasting. For certain applications, such as applications that display checksums, this can make manually copying the text quite tedious.

Here we will make something that looks and acts like a JLabel, but with fully selectable text. The 'trick' is that in actuality, the component is a JTextField, but we have modified its appearance to imitate a JLabel:



site update

The site is expanding, and many of the sections with older data are now filled in. I will be adding material in the Klang and Flex Experiments areas over the next few weeks.

new site up and running

I think I have most of the quirks of Drupal figured out now, and the skeleton of the site is up. Now I just need to fill in the content!
Syndicate content