ACTION BANNER

Listen, I didn't know what else to call it. Actually, I thought of the name because it looks like the letters they flash on the action movie promos. This would be nice to have on a movie page, TV sitcom/drama page, or any page where the user isn't slumped over in his chair fast asleep from boredom. Color coding is included in the below cut-and-paste source of this script so you know what to change.

The source..


<script language="JavaScript">
<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

var current = 0
var x = 0
var speed = 100
var speed2 = 4000

function initArray(n) {
  this.length = n;
  for (var i =1; i <= n; i++) {
    this[i] = ' '
  }
}

action = new initArray(4)
action[0]="This is Message 1"
action[1]="Now it is Message 2"
action[2]="No, do not say I have to do 3 messages"
action[3]="Yea, this message, 4, is the last message (and it's long)"

function action2() {
var m = action[current]

window.status = m.charAt(x++)

if (x == m.length + 1) {
x = 0
current++
window.status = m

if (current > action.length - 1) {
current = 0
}

setTimeout("action2()", speed2)
}

else {
setTimeout("action2()", speed)
}
}

action2()
//-->
</script>

Color coding..


The number "100" represents the wait in milliseconds between the changing of each character in the message list. Anywhere between "20" and "200" would be fine for the average webpage
The number "4000" represents the number of milliseconds between the changing of each message (2 seconds, here). Anywhere between "2500" and "5000" would be fine for the average webpage.
This is the number of different messages you have. The different messages are stated by action[the number in line -1]="The message" so you can add or subtract the number of messages in the list by knowing this.
You can change this script to display on a form instead of the statusbar by making a form input and changing "window.status" to "document.form_name.input_name.value".