Namespaces
Variants
Actions

Ticker component for Flash Lite

Jump to: navigation, search


This page explains the installation and use of the Ticker component for Flash Lite.

Contents

Description

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.

Installation

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.

Requirements

  • Adobe Flash Professional CS3 or CS4

Download

You can download the Ticker component here: Media:TickerComponent.zip

Basic usage

  • Drag the Ticker component from the Components panel to the stage
  • Open the Component Inspector panel
  • Specify the component properties (see screenshot)


Ticker-componentinspector.png

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.

Component API

Methods

  • startTicker - starts the ticker text scrolling
  • stopTicker - stops the ticker text scroll and resets
  • pauseTicker - pause the ticker text at current position
  • resumeTicker - resume the ticker text scroll after pause
  • addText - add a text message to the ticker
  • clearText - clear all text messages from the ticker


Properties

  • speed - Number value, speed at which the text scrolls (default value is 5)
  • direction - String value (left/right) specifying the direction of the text scroll (default value is left)
  • repeat - Boolean value specifying if the messages loop after all have scrolled past (default value is true)


Events

  • start - event triggers when ticker starts scrolling
  • stop - event triggers when ticker stops scrolling
  • pause - event triggers when ticker gets paused
  • resume - event triggers when ticker resumes after pause
  • next - event triggers when ticker shows next message
  • repeat - event triggers when ticker messages start repeating

Examples

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("Nokia Developer");
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);

Comments

A useful component to use in FlashLite applications. The component decsribes a scrolling text component.

The author has very well explained the configurable properties, events and method along with the code snippet showing the use of the component.--sangramp@cybage.com 12:31, 23 September 2009 (UTC)

This page was last modified on 22 June 2011, at 11:38.
45 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2012 All rights reserved