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

XML Ticker

This final ticker gets content from an XML file. A sample XML file is shown below. You can add HTML formatting directly to the text, as I've done with the [u] tags on the last line, but to keep it from being parsed by the XML parser, you must use square brackets (these will get turned back into angle brackets when the XML is parsed).

In addition, you may the XML attributes 'debut', 'exit', 'color' and 'url' on each line. Default 'color' and 'url' attibutes may be provided on the enclosing 'ticker' tag.

Sample XML File:

<?xml version="1.0" ?>
<ticker color="#0000FF">
<tickeritem debut="up" exit="up" color="#FF0000">This is the first item in the xml ticker.</tickeritem>
<tickeritem color="#0000FF">This is the second item in the ticker.</tickeritem>
<tickeritem debut="left" exit="left">This is the third item in the ticker.</tickeritem>
<tickeritem debut="right" exit="down">This is the fourth item in the ticker.</tickeritem>
<tickeritem debut="down" exit="in" color="#000000">This is the fifth item in the ticker.</tickeritem>
<tickeritem debut="in" exit="out" url="http://www.krazydad.com">This is the sixth item.</tickeritem>
<tickeritem debut="out" exit="in">Item 7.</tickeritem>
<tickeritem>[font color="#770077" url="http://www.krazydad.com"]This ticker was brought to you by [u]krazydad.com[/u] -- stay tuned for more news...</tickeritem>

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: Underwood

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