Flickering Neon sign - Help please...!

Hello folks,

I’m working on a flash banner that contains just one big headline, which I would like to make into a flickering neon sign. I would like each word to light-up one after the other, and then when the entire headline is lit up, I would like all the words to flicker at the same time for about 20 seconds and then stop and remain at 100% alpha.

I’ve created the entire headline in photoshop (as it’s not based around an existing font) and have saved each of the words as separate PNG files. For each word, there are two states of appearance: Off and On. When the flash banner begins, I want the viewer to see the headline in the “off” state. Then it will switch “on” and look like it has lit up.

I have found the code below from a site called www dot Pixel Hive Design dot com which I’ve done a test run and have been able to get a word to flicker, which is great! Now I’m just stuck on getting each word to light-up one after the other, and then when the entire headline is lit up, getting the words to flicker at the same time for about 20 seconds and then stop and remain at 100% alpha.

If anyone could help me with this it would be amazing.

Thanks in advance :thumb:


[LIST=1]
[*][COLOR=#808080][FONT=Arial]*// -------------------------------*[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// Flickering MovieClip Effect*[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// www.pixelhivedesign.com*[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// -------------------------------*[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// All time in milliseconds. (1000 = 1 second)*[/FONT][/COLOR]
[*]maxTB = [COLOR=#CC66CC][FONT=Arial]4000[/FONT][/COLOR]; [COLOR=#808080][FONT=Arial]*// Maximum time between flickering*[/FONT][/COLOR]
[*]minTB = [COLOR=#CC66CC][FONT=Arial]1000[/FONT][/COLOR]; [COLOR=#808080][FONT=Arial]*// Minimum time between flickering*[/FONT][/COLOR]
[*]flickerDuration = [COLOR=#CC66CC][FONT=Arial]2000[/FONT][/COLOR]; [COLOR=#808080][FONT=Arial]*// How long flicker will last*[/FONT][/COLOR]
[*]
[*][COLOR=#808080][FONT=Arial]*// Get a random start time.*[/FONT][/COLOR]
[*]flickerTime = getNewTime[COLOR=#66CC66][FONT=Arial]([/FONT][/COLOR][COLOR=#66CC66][FONT=Arial])[/FONT][/COLOR];
[*]
[*][COLOR=#808080][FONT=Arial]*// Every frame execute the following code.*[/FONT][/COLOR]
[*][COLOR=#0066CC][FONT=Arial]this[/FONT][/COLOR].[COLOR=#0066CC][FONT=Arial]onEnterFrame[/FONT][/COLOR] = [FONT=Arial]**function**[/FONT][COLOR=#66CC66][FONT=Arial]([/FONT][/COLOR][COLOR=#66CC66][FONT=Arial])[/FONT][/COLOR][COLOR=#66CC66][FONT=Arial]{[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// Get current time in milliseconds.*[/FONT][/COLOR]
[*]curTime = [COLOR=#0066CC][FONT=Arial]getTimer[/FONT][/COLOR][COLOR=#66CC66][FONT=Arial]([/FONT][/COLOR][COLOR=#66CC66][FONT=Arial])[/FONT][/COLOR];
[*]
[*][COLOR=#808080][FONT=Arial]*// Check if current time is past the time to flicker.*[/FONT][/COLOR]
[*][COLOR=#B1B100][FONT=Arial]if[/FONT][/COLOR][COLOR=#66CC66][FONT=Arial]([/FONT][/COLOR]curTime >= flickerTime[COLOR=#66CC66][FONT=Arial])[/FONT][/COLOR][COLOR=#66CC66][FONT=Arial]{[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// Flickering.*[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// Check if flicker has lasted the duration specified.*[/FONT][/COLOR]
[*][COLOR=#B1B100][FONT=Arial]if[/FONT][/COLOR][COLOR=#66CC66][FONT=Arial]([/FONT][/COLOR]curTime <= flickerTime+flickerDuration[COLOR=#66CC66][FONT=Arial])[/FONT][/COLOR][COLOR=#66CC66][FONT=Arial]{[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// Continue flickering.*[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// Alternate between alpha values.*[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// This creates the flicker appearance.*[/FONT][/COLOR]
[*][COLOR=#B1B100][FONT=Arial]if[/FONT][/COLOR][COLOR=#66CC66][FONT=Arial]([/FONT][/COLOR] cnt >= [COLOR=#CC66CC][FONT=Arial]2[/FONT][/COLOR][COLOR=#66CC66][FONT=Arial])[/FONT][/COLOR][COLOR=#66CC66][FONT=Arial]{[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// Reduce alpha.*[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// Lower this for more dramatic effect.*[/FONT][/COLOR]
[*][COLOR=#0066CC][FONT=Arial]this[/FONT][/COLOR].[COLOR=#0066CC][FONT=Arial]_alpha[/FONT][/COLOR] = [COLOR=#CC66CC][FONT=Arial]90[/FONT][/COLOR];
[*]cnt = [COLOR=#CC66CC][FONT=Arial]0[/FONT][/COLOR];
[*][COLOR=#66CC66][FONT=Arial]}[/FONT][/COLOR] [COLOR=#B1B100][FONT=Arial]else[/FONT][/COLOR] [COLOR=#66CC66][FONT=Arial]{[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// Increase alpha.*[/FONT][/COLOR]
[*][COLOR=#0066CC][FONT=Arial]this[/FONT][/COLOR].[COLOR=#0066CC][FONT=Arial]_alpha[/FONT][/COLOR] = [COLOR=#CC66CC][FONT=Arial]100[/FONT][/COLOR];
[*]cnt++;
[*][COLOR=#66CC66][FONT=Arial]}[/FONT][/COLOR]
[*][COLOR=#66CC66][FONT=Arial]}[/FONT][/COLOR] [COLOR=#B1B100][FONT=Arial]else[/FONT][/COLOR] [COLOR=#66CC66][FONT=Arial]{[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// Flicker lasted for duration.*[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// Stop flickering and get next time to flicker.*[/FONT][/COLOR]
[*][COLOR=#0066CC][FONT=Arial]this[/FONT][/COLOR].[COLOR=#0066CC][FONT=Arial]_alpha[/FONT][/COLOR] = [COLOR=#CC66CC][FONT=Arial]100[/FONT][/COLOR];
[*]flickerTime = getNewTime[COLOR=#66CC66][FONT=Arial]([/FONT][/COLOR][COLOR=#66CC66][FONT=Arial])[/FONT][/COLOR];
[*][COLOR=#66CC66][FONT=Arial]}[/FONT][/COLOR]
[*][COLOR=#66CC66][FONT=Arial]}[/FONT][/COLOR]
[*][COLOR=#66CC66][FONT=Arial]}[/FONT][/COLOR]
[*][COLOR=#808080][FONT=Arial]*// Create a random time between maxTB and minTB specified.*[/FONT][/COLOR]
[*][FONT=Arial]**function**[/FONT] getNewTime[COLOR=#66CC66][FONT=Arial]([/FONT][/COLOR][COLOR=#66CC66][FONT=Arial])[/FONT][/COLOR][COLOR=#66CC66][FONT=Arial]{[/FONT][/COLOR]
[*][COLOR=#B1B100][FONT=Arial]return[/FONT][/COLOR] [COLOR=#0066CC][FONT=Arial]getTimer[/FONT][/COLOR][COLOR=#66CC66][FONT=Arial]([/FONT][/COLOR][COLOR=#66CC66][FONT=Arial])[/FONT][/COLOR] + [COLOR=#66CC66][FONT=Arial]([/FONT][/COLOR][COLOR=#0066CC][FONT=Arial]Math[/FONT][/COLOR].[COLOR=#0066CC][FONT=Arial]random[/FONT][/COLOR][COLOR=#66CC66][FONT=Arial]([/FONT][/COLOR][COLOR=#66CC66][FONT=Arial])[/FONT][/COLOR] * [COLOR=#66CC66][FONT=Arial]([/FONT][/COLOR]maxTB-minTB[COLOR=#66CC66][FONT=Arial])[/FONT][/COLOR][COLOR=#66CC66][FONT=Arial])[/FONT][/COLOR]+minTB;
[*][COLOR=#66CC66][FONT=Arial]}[/FONT][/COLOR]
[/LIST]