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.
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
Sets the color of the buttons.
myTicker.buttonColor = 0xFF0000;
// sets the button color to red.
trace(myTicker.buttonColor);
// traces the value of the buttonColor;
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;
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;
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
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
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.
Sets the linespacing.
myTicker.lineSpacing = 2; // sets the line spacing to 2
trace(myTicker.lineSpacing); // traces the value of the lineSpacing property
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;
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
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;
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;
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;
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;
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;
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;
Sets the default font color.
myTicker.defaultFontColor = 0x000000;
// sets the scrollTrack color to black.
trace(myTicker.defaultFontColor); //
traces the value of the defaultFontColor property;
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;
Sets the background color.
myTicker.backgroundColor = 0x00CCFF;
// sets the backgroundColor color to cyan.
trace(myTicker.backgroundColor); //
traces the value of the backgroundColor property;
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;
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;
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;
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;
Returns
boolean value whether buttons
should be enabled on disabled
myTicker.buttonsEnabled // returns
a Boolean value representing whether buttons should be enabled or not
Method
for the left button action
Example:
myButton.onPress = function() {
myTicker.buttonLeftPress();
};
Method
for the right button action
Example:
myButton.onPress = function() {
myTicker.buttonRightPress();
};
Method
for the up button action
Example:
myButton.onPress = function() {
myTicker.buttonUpPress();
};
Method
for the down button action
Example:
myButton.onPress = function() {
myTicker.buttonDownPress();
};
Method
for the release of a button
Example:
myButton.onRelease = function() {
myTicker.buttonRelease();
};
Reinitializes
the flashTicker with new data
myTicker.reInit(); //
reloads the data into the flashTicker
isLoaded
Returns boolean value on flashTicker
loaded status
myTicker.isLoaded // returns a Boolean value representing
current flashTicker loaded status
Loads XML file into the flashTicker
myTicker.loadTickerXML(xmlFileName:String)
Example:
myTicker.loadTickerXML(“ticker.xml”)
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.
startTicker
Starts the ticker scrolling.
myTicker.startTicker();
Stops the ticker scrolling.
myTicker.stopTicker();