Saturday, September 03, 2005

CFFLUSH Example

Cut and paste this code into an editor to test CFFLUSH:

<cfparam name="url.mode" default="tbl">
<cfif url.mode eq "tbl">

<table>
<tr>
<td><cfoutput>Please wait while I count: <a href="#getfilefrompath(cgi.script_name)#?mode=div">Try Div Mode</a></cfoutput></td>
</tr>
<cfflush>

<cfloop from="1" to="100000" index="i">
<cfif i mod 100 eq 0>
<tr>
<td style="color:blue;"><cfoutput>#i#</cfoutput></td>
</tr>
<cfflush>
</cfif>
</cfloop>
</table>

<cfelse>
<div>Please wait while I count: <cfoutput><a href="#getfilefrompath(cgi.script_name)#">Try Table Mode</a></cfoutput></div>
<cfflush>

<cfloop from="1" to="100000" index="i">
<cfif i mod 100 eq 0>
<div style="color:red;"><cfoutput>#i#</cfoutput></div>
<cfflush>
</cfif>
</cfloop>
</cfif>

Friday, September 02, 2005

ColdFusion: Sort With Graphics

I would like to sort data presented in a table (alphanumeric) by pushing small arrow buttons ascending or descending order. How can I accomplish this?

Try this code to get you started:

<cfparam name="url.recordid" default="0">
<cfparam name="url.act" default="">

<cfif url.act is "increase">
<cfquery datasource="mydsn">
Update tbl_records
Set sortid = sortid + 1
Where recorded = #val(url.recordid)#
</cfquery>

<cfelseif url.act is "decrease">
<cfquery datasource="mydsn">
Update tbl_records
Set sortid = sortid - 1
Where recorded = #val(url.recordid)#
</cfquery>
</cfif>

<cfquery name="rs" datasource="mydsn">
Select * from tbl order by sortid
</cfquery>

<table>
<cfloop query="rs">
<tr>
<td>#recordname#</td>
<td><a href="index.cfm?recordid=#recordid#&act=increase">Up</a></td>
<td><a href="index.cfm?recordid=#recordid#&act=decrease">Down</a></td>
</tr>
</cfloop>
</table>

Thursday, September 01, 2005

Form With Two Buttons

I'm trying to create a javascript to handle a form with 2 buttons... each button should do something different.

In the HEAD Section of the form:
<script>
function doSubmit(actionPage)
{
document.theForm.action=actionPage
document.theForm.submit()
}
</script>

In the BODY of the form:
<input type="button" value="EDIT" onclick="doSubmit('edit.cfm')">
<input type="button" value="SUBMIT" onclick="doSubmit('submit.cfm')">

Wednesday, August 31, 2005

Underwater Filter

I have received questions pertaining on how to render an image so that it appears to have been taken under water.

Here is how you can achieve this effect.

Filter -> Distort -> Ocean Ripple
Filter -> Distort -> Glass (use frosted).

For pond effects, and water drops, try creating a soft edge circle and using the Filter -> Distort -> Zig Zag filter. This was in a tutorial in photoshop user last month. Bert Monroy went through this technique.

In the cases above I would first duplicate the image layer, then apply the filters to the duplicate layer, and play with the blending modes/opacity of the top -- duplicate -- layer.

Tuesday, August 30, 2005

Flash Player 8 Beta

In case anyone here missed it, this week Macromedia released a developers public beta of their latest Flash Player.

Now's the time to test your existing Flash or Flash projects in development for compatibility. Remember, once Flash Player 8 is officially released, there's no taking it back; better to identify and report bugs now than explain to upset clients after it it hits the streets why your content fails with the latest and greatest.

Download the beta

Report bugs

Monday, August 29, 2005

Flash Fade In-Fade Out

I am NOT an actionscript coder. In fact I'm just learning FlashMX. But I'm trying to create a slide show where an image stays on the screen for 6 seconds, fades out while the next one fades in (crossfade), 6 secs, fade out, fade in...

I could do it with motion tweening the Alpha color but it would SO long to do it that way. I figured one of the resident braniacs here would have a little snippet of code I could just cut and paste into each frame to do the job.

I would highly suggest that you check some of the following links for some help.

Actionscript.org
Canfield Studios
Tutorialized

Sunday, August 28, 2005

Photoshop - Opacity & Fill

I'm a photographer and have been using Photoshop since version 4. I don't claim to be an expert but I do OK. I was playing with filters and layer opacity on some photos I shot and it occurred to me that I don't know the difference between what "fill" does and what "opacity" does in the layers tab. They seem to do the same thing. I have a layer filled with white below a layer that I'm lowering the opacity on. I sometimes change the lower opacity layer using filters or saturation.

Opacity affects not only the pixels in the layer but also any layer styles or effects on the layer. Fill only affects the actual pixels of the layer. So a specific example. You have a shape on a layer and apply a drop shadow style to it. Reduce fill to 0% and the object itself disappears but the drop shadow remains. Drop opacity to zero and both disappear.