This page explains the installation and use of the Ticker component for Flash Lite.
Contents |
The ticker component allows you to have scrolling text across the screen and gives you the ability to set its direction, speed, whether or not it repeats and/or automatically starts. You can specify multiple messages and there's an extensive API and events for more advanced use.
Install the component by unzipping the downloaded TickerComponent.zip, double-clicking the ticker.mxp file and following the instructions in the Adobe Extension Manager. Restart Flash CS3/CS4 after installing to see the Ticker component show up in the Components panel.
You can download the Ticker component here: Media:TickerComponent.zip
Note that the component live preview updates based on the scroll direction and text you specify to give a visual indication as to what to expect.
Methods
Properties
Events
All examples below assume you have an instance of the Ticker component on stage with instance name "tickerComponent"
Programatically add text messages to the ticker
tickerComponent.addText("Forum Nokia");
tickerComponent.addText("Ticker component");
Scroll the ticker messages x times
function onRepeat(evt:Object):Void {
// when all messages scrolled by 3 times stop the ticker
if(evt.count >= 3) tickerComponent.stopTicker();
}
tickerComponent.addEventListener("repeat", onRepeat);
Get previous and current text message
function onNextMessage(evt:Object):Void {
trace("previous message:"+ evt.previousText);
trace("current message:"+ evt.currentText);
trace("current position in the message queue:"+ evt.index);
}
tickerComponent.addEventListener("next", onNextMessage);