Nothing new but I thought I’d post it up here just in case anyone wanted it – it’s a very basic spin-to-number counter – useful as a counter to show how many hits you’ve had or how many people have linked to your post etc.
Here’s what it looks like:
(View/download .swf here: http://mj7.co.uk/am1y)
To change the number just use a flashVar (or add a variable) called “num” and give it a number up to 7 digits – you can leave off the leading zeros as these will be added in automatically. So for example use:
<param name=”flashVars” value=”num=1234567″ />
You can download the FLA (I backsaved it to CS3) here: http://mj7.co.uk/am12
(NOTE: this .FLA uses mctween2 extension – you can download it here: mctween)
I’d love you to either use this as is – or even better – improve it and send it back.
If you do use it please give me a nod – if you like it enough to use it then why not share it?
UPDATE:
I had an email from someone who wanted to increase the amount of digits that show in the counter – I quickly sent him an updated version but he asked if I could give an overview of the steps I took so he could add/remove more in the future – so Raymond – this is for you!
To add more digits do the following:
Open the FLA and double click the counter to edit it – you should be able to select each digit separately now. To add more just select the digit on the far left (yes left not right) and copy it – then press CTRL+SHIFT+V to paste it in place and then use your cursors to move it to the far left (yes left – we add new digits to the left). Rename this d8 (It should have copied the instance name from the previous which was d7) – repeat this as required renaming to d9, d10, d11 etc. In the end you should have a row of digits named “d+instance number” DESCENDING – e.g. d10,d9,d8,d7,d6,d5,d4,d3,d2,d1. OK that part is done – now for the actionscript.
To update the AS view the code on Frame 1 – we’ll set the digit limit to a variable for easy updates in the future. Change line 4 (number = (_root.num!=undefined) ? _root.num.toString() : ‘1234567′;) to have the value ‘1234567890′ – or whatever you want the default counter number to be. Then under this line add a new line with this code on:
totalNums = 10; // set the value of this to the amount of digits you want to display
Then on lines 13, 15 (this is only a comment though) and 22 change the integer 7 to the variable totalNums.
Finally change the stage size to fit your new counter.
Save and preview.
To Remove Digits:
Just delete the digits from the LEFT and follow the same actionscript amends as above changing the totalNums to the amount of digits required.
…..
Job done. Any questions just shout.