Cron's Web Tech Blog

Useful scripts, utilities and classes for developers of HTML, PHP, Javascript, Actionscript, mySQL, CSS, etc. This blog will fill the occasional gaps in information I stumble across in my daily developing. If there's something I feel is missing from the vast pool of stuff already out there, I'll post it here. I'm a nice guy. You'd like me.

08 March 2016

Add or remove a CSS stylesheet to HTML using plain vanilla Javascript

›
This little function will attach or delete a new stylesheet to your html page using good old JS. The second parameter is optional so it will...
12 comments:
10 December 2015

Repeat a string in PHP with iteration counter - quick and easy function

›
When you're working through some complex program logic, low level code like manipulating strings is a distraction to write and worse, wh...
11 comments:
06 February 2014

35% off GoDaddy Discount code voucher coupon - Referral code

›
WOWCWTB Just enter the code during checkout This voucher code coupon will get you a  35% discount off GoDaddy.com products. Th...
11 comments:
21 September 2012

Loop Javascript (or Actionscript!) array based on index

›
Looping arrays is particularly useful for things like photo galleries and other iterative processes where you want the "next photo...
6 comments:
28 May 2012

Add Photoshop PSD & Illustrator AI folder thumbnails to all versions of Windows XP/2003/Vista/2008/7 32/64-bit

›
This is great. Adobe have never bothered to provide thumbnail support for windows machines. I dont know if this is because they are technica...
31 comments:
11 May 2012

Simple Javascript Pie Chart using HTML5 Canvas tag

›
I had a look around today for a handy pie chart that I could quickly drop into a new web app I'm working on and it seems there's a ...
12 comments:
23 March 2012

AS3 Load external flash SWFs into a queue to play in a consecutive sequence

›
This script imports a text file from the local directory and imports all swfs listed in the text file to play on the stage sequentially, i.e...
4 comments:
26 January 2012

Free Javascript for Rotating Website Banner or Fading Slideshow - standalone

›
As flash becomes less widespread I've had more and more instances where I need to create website banners in Javascript rather than my ol...
148 comments:
13 November 2011

Print CSS backgrounds in Google Chrome & Safari webkit

›
Up until now it's been impossible, but a new fix published this week by the chrome team makes it simple for a site developer to trigger ...
77 comments:
05 November 2011

Javascript function for checking a variables type or empty/unset variables - similar to PHP's empty()

›
I've been building on this one all week and I'm finding it more and more useful for quickly writing variable checks at the top of fu...
4 comments:
12 October 2011

How to repair Google Apps setup server errors

›
I got a tip today from a friend of mine working in Google. A server error occurred during the registration of my new domain and I was left w...
3 comments:
19 July 2011

Most simple/basic single level CSS dropdown menu without Javascript tutorial

›
Sometimes when web demos focus on extended functionality, it's difficult to identify and extract exactly what you need for your own proj...
12 comments:
17 July 2011

AS3: Simple, Powerful String Find & Replace all instances function for Flash Actionscript. Similar to PHP's str_replace replacement.

›
Exactly what it says on the tin! AS2 version here
6 comments:

AS3: Wave of values class function - produces incremental and decremental values

›
Sometimes it's necessary to have a value increment until it gets to a certain point and then have it decrement again in a wave shape. A ...
11 comments:
05 June 2011

AS3 handy weighted random & rounding functions with decimal/floating point precision

›
Like a lot of the "improvements" Adobe made to Actionscript with AS3, the Math.random() function is now a pain in the ass. It only...
18 comments:
23 April 2011

SugarSync referral link - Better than dropbox

›
If you dont backup your computer already, try this... It automatically keeps your documents synced to the web in case your computer dies som...
18 April 2011

AS3 function to rotate a 2D or 3D MovieClip or Sprite around its center or change to any registration point

›
OK here we go - I looked everywhere for this one but only found bits of code from various forums and blogs that were part of classes and pac...
4 comments:
14 March 2011

Max/MSP Javascript "find object" - lazy dollar function

›
The second function in my  " Making Max JS less crap " series, this function scans all objects in the patch and all subpatches and...
16 comments:

Max/MSP Javascript: Dollar Function - Returns a reference to a Max Object in a patch/subpatch

›
I started using Max this month and was simultaneously impressed with its power and simplicity and frustrated by it's cumbersome interfac...
189 comments:
13 February 2011

Actionscript 3: Better Random Function & Better Rounding Function

›
I was amazed at how lame the rounding and random functions are in AS3 so I've written 2 simple functions to add much needed functionalit...
90 comments:
11 February 2011

Actionscript/Javascript Colour mode conversion functions - convert HSB/HSL/HSV to RGB to web HEX color or to flash matrix

›
I wrote/found/tweaked these conversion functions today to convert between the most common colour modes. it was very difficult to find a soli...
12 comments:
23 August 2010

Javascript: Simple, Drag & Drop element class - multiple draggable elements on one page.

›
I found a tonne of these drag & drop functions online but they were all either too big & bloated or relied heavily on external libra...
7 comments:
29 June 2010

AS2: Simple, Powerful String Find & Replace all instances function for Flash Actionscript. Similar to PHP's str_replace replacement.

›
Exactly what it says on the tin! AS3 version here
18 June 2010

Resize a Movie Clip containing a mask by getting dimensions of visible bounds/area and compensating width/height

›
This was a head wrecker and took me most of the day today. Actionscript does not see Movie Clips as we do and considers invisible content to...
13 May 2010

Universal ALL DOMAIN rewrite for non-www to canonical/www using htaccess or https.conf on apache server

›
This took me a few days to get right. The lack of feedback from testing, along with browser caching and the general head wrecking-ness of R...
1 comment:
06 May 2010

PHP: Ultimate get/fetch RELATIVE PATH function between 2 folders/directories/files/pages or root dir

›
I wrote these functions today when everything I found online that attempted the same job was either too bulky, or too restrictive. It took m...
20 comments:
02 May 2010

PHP: Quick & handy browser sniffer/checker function/class

›
Yes, you can check your visitor's browser using PHP! What's more, it never goes out of date! It automatically updates to recognise t...
4 comments:

Javascript: Auto-Expand a form's select box on hover/mouseover

›
Productivity is all about cutting down mouse clicks. With this in mind, I've written this function to open/close a html dropdown menu on...
8 comments:
28 April 2010

Javascript: Set or get URL/URI/src/href of an iframe or frame/frameset function

›
This function simply targets an iframe or frameset and retrieves or changes it's src or href attribute.
6 comments:
27 April 2010

Add padding or a solid background to a Movie Clip with Flash Actionscript AS2

›
I wrote this little function today to add HTML style padding to a Flash MovieClip. It took a lot of testing to get working but it's actu...
4 comments:
21 April 2010

PHP: Image resize function for calculating & constraining image proportions to fit in a box or space

›
I wrote this function on the back of my Actionscript version to calculate the output size of an image. If you only have a certain amount of...
7 comments:
27 November 2009

PHP: How to Compare Directory Attributes & all files within

›
I wrote this function today to compare the contents of two folders or directories based on 3 comparison points: Do files exist in both di...
8 comments:
25 November 2009

Javascript: Get/Set Caret Cursor position in iframe WYSIWYG editor

›
I've been working on this for 3 months now on and off, using code snippets from the net and asking questions in forums, etc. I'm try...
224 comments:
24 November 2009

PHP: How to upload ZIP, check if file exists within it & extract to the server

›
I had to do this today for a job. It took far longer than it should have. The resources online are minimal and php.net does not mention any ...
6 comments:
11 November 2009

AS2: PHP style trim for Actionscript 2 - with 'any' character support

›
Theres a few of these functions around but none (that I could find) will allow you to trim non whitespace characters so I pulled this one to...
4 comments:
09 November 2009

Free AS2 Script for Rotating Website Banner or Slideshow in Flash

›
This is a simple AS2 function to turn a normal flash MovieClip into a rotating banner or fading photo slideshow for a website. Tim...
5 comments:
19 October 2009

Resize function for image or MovieClip with advanced options - Actionscript2 AS2

›
I found myself often needing to resize images to fit different spaces using actionscript so I wrote this handy function a while back. It all...
7 comments:
14 October 2009

mySQL to Flash import class - run queries from AS2 simply & automatically

›
mySQL2AS package with DataGrid... This incredibly simple tool takes 5 minutes to set up and allows you to run mySQL queries and return resu...
17 comments:
04 October 2009

Save JPG /PNG image from AS2 project using AS3 & PHP

›
There's a tonne of Actionscript 2 image capture scripts out there but after an extensive search last month, the best ones I could find a...
52 comments:
26 September 2009

Javascript ScrollFix: Remember scroll position after page reloads.

›
I've seen a tonne of great web apps with this annoying quirk: When you press save or OK on a settings page, it  jumps back to the top as...
43 comments:
18 September 2009

PHP class to Import/Export mySQL to CSV or Excel

›
Import/Export mySQL to CSV class: This class (not really a class but thought the keyword "class" might help people searching for...
35 comments:
30 August 2009

About the banner...

›
The banner image for this blog was my my first attempt at generating something pretty using Flash Actionscript. I later did a few more exper...
2 comments:
29 August 2009

Hello World!

›
A new blog: This blog will fill the occasional gaps in information I stumble across in my daily developing. If there's something I feel ...
6 comments:
Home
View web version
Powered by Blogger.