ok, i think i'm going nuts.
I've worked out a flash news ticker... but as soon as I try to change the font face of one of the items in the array, it doesnt display that particular item. (as shown in the example for the first item) any ideas?
i'm SURE its something little that i'm just missing.
here's the as..
SW = Stage.width; // scene width
SH = Stage.height; // scene height
var tickerItems = [
'<font size="25" face="arial">score number one</font>',
'<font size="25">score number two</font>',
'<font size="25">score number three</font>',
'<font size="25">score number four</font>',
'<font size="25">score number five</font>',
'<font size="25">score number six</font>',
'<font size="25">score number seven</font>',
'<font size="25">score number eight</font>'
];
MovieClip.prototype.getTickerItem = function
{
this.idx = n;
this.ticker_txt.htmlText = tickerItems[n];
this.startTime = getTimer();
this.ticker_txt._x = 0;
this.ticker_txt._y = -this.ticker_txt.textHeight/1.75;
this._x = SW;
this._y = SH/2;
}
function cycleTicker()
{
this._x -= this.speed;
if (this._x <= -this.ticker_txt.textWidth)
this.getTickerItem((this.idx+1)%tickerItems.length);
}
var mc = this.attachMovie("ticker_mc", "ticker_mc", i);
mc.ticker_txt.autoSize = "left";
mc.ticker_txt.html = true;
mc.getTickerItem(0);
mc.idx = 0;
mc.speed = 5;
mc.onEnterFrame = cycleTicker;
mc.onRollOver = function() { this.speed = 2; }
mc.onRollOut = function() { this.speed = 5; }
thanks in advance!
ck
I've worked out a flash news ticker... but as soon as I try to change the font face of one of the items in the array, it doesnt display that particular item. (as shown in the example for the first item) any ideas?
i'm SURE its something little that i'm just missing.
here's the as..
SW = Stage.width; // scene width
SH = Stage.height; // scene height
var tickerItems = [
'<font size="25" face="arial">score number one</font>',
'<font size="25">score number two</font>',
'<font size="25">score number three</font>',
'<font size="25">score number four</font>',
'<font size="25">score number five</font>',
'<font size="25">score number six</font>',
'<font size="25">score number seven</font>',
'<font size="25">score number eight</font>'
];
MovieClip.prototype.getTickerItem = function

{
this.idx = n;
this.ticker_txt.htmlText = tickerItems[n];
this.startTime = getTimer();
this.ticker_txt._x = 0;
this.ticker_txt._y = -this.ticker_txt.textHeight/1.75;
this._x = SW;
this._y = SH/2;
}
function cycleTicker()
{
this._x -= this.speed;
if (this._x <= -this.ticker_txt.textWidth)
this.getTickerItem((this.idx+1)%tickerItems.length);
}
var mc = this.attachMovie("ticker_mc", "ticker_mc", i);
mc.ticker_txt.autoSize = "left";
mc.ticker_txt.html = true;
mc.getTickerItem(0);
mc.idx = 0;
mc.speed = 5;
mc.onEnterFrame = cycleTicker;
mc.onRollOver = function() { this.speed = 2; }
mc.onRollOut = function() { this.speed = 5; }
thanks in advance!
ck