home page icon Flash Bestiary / Fun with Text / Basic Ticker
   

Basic Ticker

The next few movies illustrate how to create a text ticker which is driven by XML data.

This first ticker is a simple horizontal scroller, which gets its text from an array inside the actionscript. This is what my array looks like:

var tickerItems = [
 '<font color="#FF0000"><a href="http://www.krazydad.com" target="_top">This ticker was brought to you by krazydad.com</a></font>',
 '<font color="#0000FF">This is the second item in the ticker.</font>',
 '<font color="#0000FF">This is the third item in the ticker.</font>',
 '<font color="#0000FF">This is the fourth item in the ticker.</font>',
 '<font color="#000000">This is the fifth item in the ticker.</font>',
 '<font color="#0000FF"><a href="http://www.krazydad.com" target="blank">This is the sixth item.</a></font>',
 '<font color="#0000FF"><a href="http://www.krazydad.com" target="blank">Item 7.</a></font>',
 '<font color="#330033"><a href="http://www.krazydad.com" target="_top">This ticker was brought to you by <u>krazydad.com</u></a> -- stay tuned for more news...</font>'
];

The text may contain URLs, and color changes, but not much else.

UPDATE: The source code below now contains an Actionscript 3 version, in addition to the original Flash MX code.

 

sourcecode iconDownload the flash project
book iconJim's Favorite Actionscript Books
wiki iconAsk Jim about Actionscript
Next: Ticker with Effects

Having trouble opening the project? You may need to Upgrade to Flash CS3



Copyright © 2003,2008 by Jim Bumgardner. All Rights Reserved.        Leave Jim some feedback