flashTicker ActionScript Reference

 

 

 

Introduction

 

Properties

 

fileType

scrollDirection

scrollPosition

scrollSpeed

increment

singleLine

pauseTime

pauseOver

handCursor

roundSpacer

pauseTime

spacer

buttons

buttonSpeed
buttonColor
bufferLeft

bufferRight

bufferTop

textWidth

textAlign

lineSpacing

imagePosition

imageVertical

imageSpacer

visited

visitedColor

embedFonts

defaultFont

defaultFontSize

defaultFontColor

background

backgroundColor

rolloverFontChange

rolloverFontColor

rolloverBackground

rolloverBackgroundColor

 

 

Methods

 

buttonsEnabled

buttonLeftPress

buttonRightPress

buttonUpPress

buttonDownPress

buttonRelease

reInit

isLoaded

loadTickerXML

loadTickerArrays

startTicker

stopTicker

 

         

 


Introduction

 

The following document details the use of the properties and methods of the flashTicker Component via ActionScript.

 

If you don’t want to use ActionScript, all of the following properties and methods can be set within Flash MX or Flash MX 2004 by dropping the flashTicker Component onto the scroll target, scaling the component to the desired size and setting the properties shown in the Parameters Panel.

All examples are based on the flashTicker component having an instance name of ‘myTicker’. In your own movie, you will replace this with whatever you name the instance of the flashTicker Component.

 

Properties

 

fileType

 

Sets the type of files to load to xml or text.

 

myTicker.fileType = “text”; // specifies the data file to be a text file.

 

myTicker.fileType = “xml”; // specifies the data file to be an xml file.

 

trace(myTicker.fileType); // outputs the current value;

 

TOP

scrollDirection

 

Sets whether the ticker scrolls incrementally (top to bottom/left to right) or decrementally (bottom to top/right to left).

 

myTicker.scrollDirection = “incremental”; // scrolls top to bottom or left to right.

 

myTicker.scrollDirection = “decremental”; // scrolls bottom to top or right to left.

 

trace(myTicker.scrollDirection); // outputs the current value;

 

TOP

scrollPosition

 

Defines whether the ticker scrolls horizontally or vertically.

 

myTicker.scrollPosition = “horizontal”; // scrolls left to right or right to left.

 

myTicker.scrollPosition = “vertical”; // scrolls top to bottom or bottom to top.

 

trace(myTicker.scrollPosition); // traces the value of the scrollPosition property;

 

TOP

scrollSpeed

 

Sets the speed at which the ticker scrolls.

 

myTicker.scrollSpeed = 10; // sets the scroll speed of the ticker to 10.

 

trace(myTicker.scrollSpeed); // traces the value of the scrollSpeed property;

 

TOP

increment

 

Sets the scroll increment.

 

myTicker.increment = 2; // sets the scroll increment of the ticker to 2.

 

trace(myTicker.increment); // traces the value of the increment property;

 

TOP

singleLine

 

Sets the scrolling text should be on a single horizontal line with variying text lengths.

 

myTicker.singleLine = true; // sets the text to be on a single line.

 

trace(myTicker.singleLine); // traces the value of the singleLine property;

 

TOP

pauseTime

 

Sets the amount of time to pause before each topic disappears.

 

myTicker.pauseTime = 30; // sets the pause time to 30.

 

trace(myTicker.pauseTime); // traces the value of the pauseTime property;

 

TOP

pauseOver

 

Sets whether to pause scrolling on mouseover.

 

myTicker.pauseOver = true; // sets the scrolling to pause on mouseover.

 

trace(myTicker.pauseOver); // traces the value of the pauseOver property;

 

TOP

handCursor

 

Sets whether display a hand cursor on clickable topics.

 

myTicker.handCursor = true; // sets the hand cursor to display on clickable topics on mouseover.

 

trace(myTicker.handCursor); // traces the value of the handCursor property;

 

TOP

roundSpacer

 

Sets the space (in pixels) between completed round of topics.

 

myTicker.roundSpacer = 50; // sets the spacer between round of topics to 50 pixels.

 

trace(myTicker.roundSpacer); // traces the value of the roundSpacer property;

 

TOP

spacer

 

Sets the distance (in pixels) between topics.

 

myTicker.spacer = 15;// sets the space between topics to be 15 pixels.

 

trace(myTicker.spacer); // traces the value of the spacer property;

 

TOP

border

 

Defines whether to display a border or not.

 

myTicker.border = true;// sets the border to display.

 

trace(myTicker.border); // traces the value of the border property;

 

TOP

borderColor

 

Sets the color of the border.

 

myTicker.borderColor = 0xCCCCCC; // sets the border color to silver.

 

trace(myTicker.borderColor); // traces the value of the borderColor property;

 

TOP

buttons

 

Defines whether to display buttons or not and button position.

 

myTicker.buttons = “none”; // no buttons are displayed.

 

myTicker.buttons = “top”; // buttons are displayed above of the ticker.

 

myTicker.buttons = “bottom”; // buttons are displayed below the ticker.

 

myTicker.buttons = “left”; // buttons are displayed to the left of the ticker.

 

myTicker.buttons = “right”; // buttons are displayed to the right of the ticker.

 

trace(myTicker.buttons); // traces the value of the buttons property;

 

TOP

buttonSpeed

 

Sets the scroll speed of the buttons.

 

myTicker.buttonSpeed = “1”; // sets button scroll speed to 1.

 

trace(myTicker.buttonSpeed); // traces the value of the buttonSpeed property;

 

TOP

buttonColor

 

Sets the color of the buttons.

 

myTicker.buttonColor = 0xFF0000; // sets the button color to red.


trace(myTicker.buttonColor); // traces the value of the buttonColor;

 

TOP

bufferLeft

 

Sets the amount of space (in pixels) between the border and the left of the scrolling text.

 

myTicker.bufferLeft = 10; // sets the left buffer to 10 pixels;

 

trace(myTicker.bufferLeft); // traces the value of bufferLeft;

 

TOP

bufferRight

 

Sets the amount of space (in pixels) between the border and the right of the scrolling text.

 

myTicker.bufferRight = 10; // sets the right buffer to 10 pixels;

 

trace(myTicker.bufferRight); // traces the value of bufferRight;

 

TOP

bufferTop

 

Sets the amount of space (in pixels) between the border and the top and bottom of the scrolling text.

 

myTicker.bufferTop = 10; // sets the top and bottom buffers to 10 pixels

 

trace(myTicker.bufferTop); // traces the value of bufferTop

 

TOP

textWidth

 

Sets the width (in pixels) of the topic text.

 

myTicker.textWidth = 200; // sets the text width to 20 pixels

 

trace(myTicker.textWidth); // traces the value of the textWidth property

 

TOP

textAlign

 

Sets the alignment of the text.

 

myTicker.textAlign = “center”; // sets the text alignment to center

 

trace(myTicker.textAlign); // traces the value of the textAlign property

 

Options: “left”, “right”, “center”. Default = left.

 

TOP

lineSpacing

 

Sets the linespacing.

 

myTicker.lineSpacing = 2; // sets the line spacing to 2

 

trace(myTicker.lineSpacing); // traces the value of the lineSpacing property

 

TOP

imagePosition

 

Defines the image position relative to the text placement.

 

myTicker.imagePosition = “left”; // sets the image position to left.

 

myTicker.imagePosition = “right”; // sets the image position to right.

 

myTicker.imagePosition = “center”; // sets the image position to center.

 

trace(myTicker.imagePosition); // traces the value of the imagePosition property;

 

TOP

imageVertical

 

Sets the vertical image position to top or bottom.

 

myTicker.imageVertical = “top”; // sets the vertical position to top.

 

myTicker.imageVertical = “bottom”; // sets the vertical image position to bottom.

 

trace(myTicker.imageVertical); // traces the value of the imageVertical property

 

TOP

imageSpacer

 

Sets the amount of space (in pixels) between the image and the text.

 

myTicker.imageSpacer = 10; // sets the imageSpacer to 10 pixels;

 

trace(myTicker.imageSpacer); // traces the value of imageSpacer;

TOP

visited

 

Defines whether to change the text color after topic has been clicked or not.

 

myTicker.visited = true; // changes the text color on mouse press

 

trace(myTicker.visited); // traces the value of the visited property;

 

TOP

visitedColor

 

Sets the visited color of the text.

 

myTicker.visitedColor = 0xFF00FF; // sets the visited color to magenta.

 

trace(myTicker.visitedColor); // traces the value of the visitedColor property;

 

TOP

embedFonts

 

Defines whether to used embed fonts or not.

 

myTicker.embedFonts = true; // sets the embedFonts value to true.

 

trace(myTicker.embedFonts); // traces the value of the embedFonts property;

 

TOP

defaultFont

 

Sets the default font.

 

myTicker.defaultFont = “FFF Business”; // sets the default font to FFF Business.

 

trace(myTicker.defaultFont); // traces the value of the defaultFont property;

 

TOP

defaultFontSize

 

Sets the default font size.

 

myTicker.defaultFontSize = 8; // sets the size of the default font

 

trace(myTicker.defaultFontSize); // traces the value of the defaultFontSize property;

 

TOP

defaultFontColor

 

Sets the default font color.

 

myTicker.defaultFontColor = 0x000000; // sets the scrollTrack color to black.

 

trace(myTicker.defaultFontColor); // traces the value of the defaultFontColor property;

 

TOP

background

 

Defines whether topic has a background color or not.

 

myTicker.background = true; // sets the background to be visible

 

trace(myTicker.background); // traces the value of the background property;

 

TOP

backgroundColor

 

Sets the background color.

 

myTicker.backgroundColor = 0x00CCFF; // sets the backgroundColor color to cyan.

 

trace(myTicker.backgroundColor); // traces the value of the backgroundColor property;

 

TOP

rolloverFontChange

 

Defines whether the font should change color on rollover or not.

 

myTicker.rolloverFontChange = true; // sets the font color to change on mouseover.

 

trace(myTicker.rolloverFontChange); // traces the value of the rolloverFontChange property;

 

TOP

 

rolloverFontColor

 

Sets the font color for mouseover.

 

myTicker.rolloverFontColor = 0xFF0000; // sets the rollover font color color to red.

 

trace(myTicker.rolloverFontColor); // traces the value of the rolloverFontColor property;

 

TOP

rolloverBackground

 

Defines whether topic has a background color on mouseover or not.

 

myTicker.rolloverBackground = true; // sets the background to appear on mouseover

 

trace(myTicker.rolloverBackground); // traces the value of the rolloverBackground property;

 

TOP

rolloverBackgroundColor

 

Defines whether topic has a background color on mouseover or not.

 

myTicker.rolloverBackgroundColor= 0x00FF99; // sets the mouseover backgroundColor color to green.

 

trace(myTicker.rolloverBackgroundColor); // traces the value of the rolloverBackgroundColor property;

 

 

Methods

 

 

buttonsEnabled

Returns boolean value whether buttons should be enabled on disabled

 

myTicker.buttonsEnabled // returns a Boolean value representing whether buttons should be enabled or not

TOP

 

buttonLeftPress

Method for the left button action

 

Example:

 

myButton.onPress = function() {

          myTicker.buttonLeftPress();

};

TOP

 

buttonRightPress

Method for the right button action

 

Example:

 

myButton.onPress = function() {

          myTicker.buttonRightPress();

};

 

TOP

buttonUpPress

Method for the up button action

 

Example:

 

myButton.onPress = function() {

          myTicker.buttonUpPress();

};

 

TOP

buttonDownPress

Method for the down button action

 

Example:

 

myButton.onPress = function() {

          myTicker.buttonDownPress();

};

 

TOP

 

buttonRelease

Method for the release of a button

 

Example:

 

myButton.onRelease = function() {

          myTicker.buttonRelease();

};

 

TOP

reInit

Reinitializes the flashTicker with new data

 

myTicker.reInit();     // reloads the data into the flashTicker

TOP

 

isLoaded

Returns boolean value on flashTicker loaded status

 

myTicker.isLoaded // returns a Boolean value representing current flashTicker loaded status

TOP

 

 

loadTickerXML

Loads XML file into the flashTicker

 

myTicker.loadTickerXML(xmlFileName:String)

 

Example:

 

myTicker.loadTickerXML(ticker.xml”)

 

TOP

 

 

loadTickerArrays

Initializes and starts the flashTicker with arrays

myTicker.loadTickerArrays(dataArray:Array, targetArray:Array, targetName:String, targetIsURL:Boolean);

 

Example:

 

dataArray = new Array(“This is topic one”, “This is topic two”, “This is topic three”);

targetArray = new Array(“http://www.flashloaded.com”, “http://www.fontsforflash.com”, “http://www.fonts4flash.com”);

 

myTicker.loadTickerArrays(dataArray, targetArray, “_blank”, true);

 

Note: null values can be entered for targetArray and targetName.

 

TOP

 

startTicker

 

Starts the ticker scrolling.

 

myTicker.startTicker();

TOP

 

 

stopTicker

 

Stops the ticker scrolling.

 

myTicker.stopTicker();

 

TOP