Loading Images in a cfform

I made an example that shows how to load different types of images into a flash form.
In a cfform, it is possible to load gif, jpg, png, and swf.

Basically, there are two types of methods to load an image inside a cfform: at compile time and at runtime. cfinput embeds the images in the cfform at compile time, allowing more variety of image types (png and gif) that are not directly supported by the flash player. cfformitem and other controls such as textarea load the images at run time, so they are limited to the types supported by the flash player, accepting only jpg and swf .
Note that cfinput type="image" will put the image inside a button, so in the example, the first four images have borders and rollover states.


I made an example that shows how to load different types of images into a flash form.
In a cfform, it is possible to load gif, jpg, png, and swf.

Basically, there are two types of methods to load an image inside a cfform: at compile time and at runtime. cfinput embeds the images in the cfform at compile time, allowing more variety of image types (png and gif) that are not directly supported by the flash player. cfformitem and other controls such as textarea load the images at run time, so they are limited to the types supported by the flash player, accepting only jpg and swf .
Note that cfinput type="image" will put the image inside a button, so in the example, the first four images have borders and rollover states.

There seems to be a bug when loading jpg images in Firefox when the cfformitem only contains the image. Although it only happens sometimes, the image does not load. One way to fix the problem is adding some text in the formitem before the image, or other tag, such as a <p>.

Here is the code:

You can also load a jpg with css but that goes to another post :)

View the example
Download the code