Customizable Marquee – The Power of an Array

This little project shows a customizable marquee sign.
Features include:

1. Ability to change the message
2. Scroll speed adjustment from level 0-10.
3. Custom digital “font”. Italic 5×7 LED style
4. Support for all numbers 0-9 and full English alphabet both upper and lower case
5. Support for many different symbols.  ()?!.$=-,+<>/
6. A 12-Digit display capable of showing both long and short messages.

The General Design

This project makes heavy use of the array which is an indexed list of many items. In this case, we use two arrays. One to store the full message as it is written. A second one to break down the message into individual characters.

For example – if my message simply displayed the word “dog” – the first array would hold a single index of dog.

array1 = [“dog”]

The second array will hold each character as its own index. This is done using a  split method on the array.

array2 = array1[0].split(“”);

array2 = [“d”,”o”,”g”]

This is what allows us to easily manipulate the individual characters for the display.

The  onEnter  action contains a few initial parameters and three functions

One function to update the characters on the display.  display();
One function to update the message being displayed.   adjustMsg();
One function to completely clear the display when changing messages.   clrScreen();

Variables are used to track the characters across the display and to change each digit accordingly.
Also, a carefully named set of object states allows for concatenation using the variable values as part of the naming convention.

The  Update  button simply calls the  adjustMsg();  function

The  up/down  triangles adjust the speed value and lock it to a specific range.

Arrays and the ability to manipulate them provide your Captivate projects some really amazing potential.

Feel free to take a look at what we have here. Ask any questions you may have and by all means – let me know about any bugs.

Preview Project

The post Customizable Marquee – The Power of an Array appeared first on eLearning.

An example of a project using arrays to create a nice scrolling message effect.
The post Customizable Marquee – The Power of an Array appeared first on eLearning.Read MoreBlog, eLearning Projects, Tips and Tricks, arrays, blog, elearning projects, JavaScript

Leave a Reply

Your email address will not be published.