Thanks Guys.. Just wait and see what I'll come up with later..
I'm still in the beginner/intermediate phase. Luckily for me Action Script is so close to VB that I don't have a huge learning curve.
The hardest part for me has been the graphics. Takes me 4 times longer to create the graphics than it does to animate this stuff.
Plus I try and write my code so it's portable. I used the exact same script with no changes for both the NIXIE Circuit clock and the NIXIE Tube clock.
And with that done, I can port a new clock just by replacing the graphics.
For those programmers interested in this.. This is how simple it was: (tube example)
I started with the tubes in Photoshop, sliced up the strip of tubes Tommy found on the net. Each the exact same size. Looking back I should have paid more attention to the shadows and cleaned them up. I might go back and do this.
On paper I sketched out my layout. 4 tubes in 2 pairs
Decided where each bulb would go and gave it a location name:
HA- Hours digit 1
HB- Hours digit 2
MA- Minute digit 1
MB- Minute digit 2
Started with a blank stage, imported my graphics and created 49 layers. 12 digits per location. Giving each layer a unique name based on the location and digit.
Hour Digit 1 = HA0 .. HA11
Hour Digit 2 = HB0 .. HB11
Minute digit 1 = MA0 .. MA11
Minute digit 2 = MB0 .. MB11
12 digits per location? Yeah. 0-9 plus the dash and tube off, because that's what was in that set of tubes and I didn't know what I might want to do later. And a layer I called StagingGround.
On the StagingGround I dragged each digit out one at a time and converted it to a Movie Clip Symbol. Naming it for the digit it was and then deleted it from the stage.
On this layer I then placed 4 tubes in the exact position I wanted all the others. Noting the position in the properties. Every one had the same Y position and I just tweaked the X position to get good spacing and then locked the layer.
Starting with layer HA0, I put the 0 digit on the stage and gave it the instance name "ha0", manually typed in the X and Y coordinates. Went to the layer and tuned it off and on to make sure it was aligned properly, then locked the layer and tuned it off (hide).
Moving to layer HA1, I put the 1 digit on the stage and gave it the instance name "ha1", typed in the position, tuned it on and off a few times and locked and hide it.
Going up in a progression until all the layers were filled with one digit in the right spot based off the name of the layer. ( yes I screwed up a few times.. heheh)
Then came the code.. The secret here was just a loop that compared the time and made the digits visible or not:
function display(test, me)
{
if (test == "1")
{
eval(me + "a" + 1)._alpha = "100";
}
With an extra script to turn on 2 digits if the hours were 10 or greater.
Same type of script for the Minutes, Seconds, and the Calendar date.. Since this script was written for the circuit clock all those locations were already in the script. But since there was no graphics named for them, it just kept going.
Then a few test runs.. some tweaking.. And finally I selected all layer and all objects and moved them down to their final position. Since I had planned on some sort of stand for them it was uber easy just to move the base off the stage a bit to give it a clean edge.
While it seems like a lot of work, I have a method to my madness and this type of layout helps me find problems. Sure I could have just created 4 layers or even just one and put all the digits together and switched them on or off. But I like my way better. It helps me allot.
Now as a side note.. I freaked when I had my finished clock. It's published size was 137K and I thought oh crap it's too big, I'm gonna have to redo all the images and shrink them.. But after looking around a bit I found that the digits which I had put in PNG format were uncompressed. So I went back and switched the compression for each imported picture to JPEG in the pictures property and low and behold it shrank to 43K.
I hope this helps someone wanting to do something like this.. Sometime in the future I might write up a full tutorial, but until then just hit up my email link and ask away.
MyridoM
And if you like them, don't forget to rate them. Until Chumby starts giving developers some hard numbers for the number of our widgets being used, the rating system is all we have to put a smile on our faces and know that someone somewhere likes us.. I mean the widgets... LOL
When someone annoys me, it takes 42 muscles in my face to frown...but it takes only 4 muscles to extend my arm and b**ch-slap you!
http://haunterofthenight.com/ * new blog location