PDA

View Full Version : led sticker font size


alesspunk
07-12-2005, 09:48 PM
hi friends i got a led ticker component but a i have some questions

I want to change the font size, i know that this script and change the canvas size.

The other question is how i get a .txt file with loadVariables(); and put it in a parameter field.

Thanks a lot..

slc = 1; //part of letter
let = 0; //place of letter in text
lev = 0; //level of new dots to attach

text = text.toUpperCase(); //make sure its capitals

//get alphabet. Has onData to fire setUp() below:
alpha.loadVariables("led_alpha.txt");


//-----------------------------------------------
// setUp() function
//
// called bt alpha mc when it has loaded the
// the alphabet
//
//-----------------------------------------------
function setUp() {
//k is used for _levels of attached movies:
var k = 0;
//double loops for x and y grid:
for (var x = 0; x < across; x++) {
for (var y = 0; y < down; y++) {
//attach a new clip:
ofDots.attachMovie("off","off"+k,k);
//quick access object:
var me = ofDots["off"+k];
//placement:
me._x = x*(me._width + spread);
me._y = y*(me._height + spread);
k++;
}
}
//get the first letter:
getLetter();
ticer.ticking = true;
}



//---------------------------------------------
// tic() function
//
// called onClipEvent (enterFrame) by ticer mc
//
//---------------------------------------------
function tic() {
//allow for pause:
count++;
if (count>pause) {
//move all onDots:
for (i in onDots) {
dot = onDots[i];
dot._x -= dot._width+spread;
//bit it if it's gone too far:
if (dot._x<0) { removeMovieClip(dot) }
}
//get new slice:
getSlice();
count=0;
}
}


//-------------------------------------------
// getSlice() function
//
// called by tic() function when count>pause
//
// letters look like this:
// a1=0111111 a2=100100 a3=100100 a4=100100 a5=011111
// these parts form the 'columns' of each letter,
// with the 1's being where 'onDot's should go
//
//-------------------------------------------
function getSlice() {
//get the slice values:
var dots = alpha[cur+slc];
//loop through the 1's and 0's:
for (var i=0; i<7; i++) {
//if it's a 1, attach a new onDot:
if (dots.substring(i,i+1)=="1") {
//attach level calculation and limit:
lev++; if(levs>across*down){lev=1}
//attach & place:
onDots.attachMovie("on","on"+lev,lev);
var me = onDots["on"+lev];
me._x = (across-1)*(me._width+spread);
me._y = i*(me._height+spread);
}
}
//increment + limit slc value:
slc++;
if (slc>6) { //val is 6 to allow for single column space
slc=1;
getLetter();
}
}

//--------------------------------------------
// getLetter() function
//
// called once by setUp() and thereafter by getSlice()
// when slc>6
//
//--------------------------------------------
function getLetter() {
//get the new letter:
cur = text.substring(let,let+1);
//check to see if it's a space:
if (cur==" ") {cur=space}
let++; //inc value
if (let>=text.length) {let=0} //repeater
}

You can download de fla file here (http://www.icamos.com/clientes/emisores/ticker.zip)