web.erratica

a resource site for web designers and developers and clients

Archive for the ‘flash + actionscript’


getting pages with flash to validate

I spent a good portion of last week taking my own site, rrinterative.com, out of tables, creating nice tableless css and then making sure it validated. Of course you know the one about the cobblers children - I preach search friendly valid code but when it came time to put my own site up I pretty much just threw it up there nasty old tables and all.

I’m not done - a couple of pages still need work but the biggest hurdle in the process was that the validator [as you may have experienced yourself] does not like the embed tag - you know, the one Netscape based browsers, including my version of Firefox, require or Flash will not display properly.

I didn’t want to give up the Flash file, I wanted it to validate.

And so it does with a nifty conditional statement.

This is for ColdFusion but the same thing can be done in php, .NET whatever. . .

So here is my code - I’m including it all from the opening to closing object tag:

<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ codebase=”http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0″ width=”531″ height=”179″ title=”Bubble Flash”><param name=”movie” value=”bubblesrrv1.swf” />
<param name=”quality” value=”high” />
<cfif #Find(”Netscape”,CGI.HTTP_USER_AGENT)#><embed src=”bubblesrrv1.swf” quality=”high” pluginspage=”http://www.macromedia.com/go/getflashplayer” type=”application/x-shockwave-flash” width=”531″ height=”179″ /></cfif>
<cfif #Find(”Firefox”,CGI.HTTP_USER_AGENT)#><embed src=”bubblesrrv1.swf” quality=”high” pluginspage=”http://www.macromedia.com/go/getflashplayer” type=”application/x-shockwave-flash” width=”531″ height=”179″ /></cfif></object>

I’m sure there are better methods out there. This worked for now.

Flash Countdown Clock

I needed to create a countdown to election day clock for a web site I oversee. After a php version proved unsatisfactory (you had to reload the page to see the change in time) I searched the web for a Flash version.

I’m sure there are others out there. I was able to find code for a clock that counted down to midnight (didn’t take into account multiple days) or one that you could generate on a website and use as an include but wasn’t self customizable for look and feel.

I finally created my own.

I am hoping this will prove useful to others. . .its a very simple design but you change the look and feel to be as loud and spectacular as you like. The important parts are the actionscript and the dynamic text fields.

The actionscript is heavily commented so you should find it easy to customize.

All I ask is that you email me [ robin@rrinteractive.com ] and let me know where you have used it. Otherwise its free.

If you find any bugs or improve upon it share with us here.

Here is the zip file: clock3fla.zip