mpalmer12345
Programmer
I'm trying to scale up some letters in a text, but I also want to keep them exactly centered in the middle of the screen. Is there a better way to do this than simply to adjust the y-coordinate in some crude fashion as the scale grows larger such as I am doing below? It seems that every letter might have to be individually adjusted based on its specific size etc.
(excerpt of relevant code)
(mc.y is the y-location of the lower-left part of the text on the screen)
function createAllText(textList) {
for(var i=0;i<textList.length;i++) {
// create movie clip
mc = createText(i,textList);
// set location
mc._x = 100;
mc._y = 100;
// set scale to 0
mc._xscale = 0;
mc._yscale = 0;
// set scale var to negative amount
mc.scale = 0-i*250;
}
}
function init() {
// create array of text
var words = "LovePeaceDestinyLlamasFate Rocks";
var textList = words.split("");
// create AT movie clips
createAllText(textList);
}
function moveText() {
// loop through words
for(var i=0;i<numWords;i++) {
// increase the scale
mc = this["text"+i];
mc.scale += 10;
mc._xscale = mc.scale;
mc._yscale = mc.scale;
mc._y += 1;
}
}
(excerpt of relevant code)
(mc.y is the y-location of the lower-left part of the text on the screen)
function createAllText(textList) {
for(var i=0;i<textList.length;i++) {
// create movie clip
mc = createText(i,textList);
// set location
mc._x = 100;
mc._y = 100;
// set scale to 0
mc._xscale = 0;
mc._yscale = 0;
// set scale var to negative amount
mc.scale = 0-i*250;
}
}
function init() {
// create array of text
var words = "LovePeaceDestinyLlamasFate Rocks";
var textList = words.split("");
// create AT movie clips
createAllText(textList);
}
function moveText() {
// loop through words
for(var i=0;i<numWords;i++) {
// increase the scale
mc = this["text"+i];
mc.scale += 10;
mc._xscale = mc.scale;
mc._yscale = mc.scale;
mc._y += 1;
}
}