
07-14-2004, 10:39 AM
|
|
Registered User
|
|
Join Date: Jun 2004
Location: CHICAGO
Posts: 148
Rep Power: 9
|
|
|
font
How do I change font size and type(to Fixedsys) in this code?
 Actionscript:
// set initialization variables
var speedBetweenLetters = 500;
var speedBetweenWords = 5000;
var j = 0;
// create array that contains the words we want to animate in
var words_array = new Array("Welcome", "Home");
// function that sets the way for a word
function createWord() {
// clear any previous interval
clearInterval(wordID);
// create empty clip to place each letter clip into
_root.createEmptyMovieClip("PH_mc", 0);
// get specified word from 'words_array' and use split method for arrays
// to stick each letter as an element in the 'message_array'
var message_str = words_array[j];
var message_array = message_str.split("");
// initialize 'i'
i = 0;
// get the interval going that creates each letter
letterID = setInterval(createLetter, speedBetweenLetters, message_array);
// if 'j' is at the end of the array, then reset it, otherwise add one to 'j'
if (j >= words_array.length - 1) {
j = 0;
} else {
j++;
}
}
// function that sets the way for each letter
function createLetter(array) {
// create text field for each letter
var n = "text_" + i;
var c = PH_mc.createEmptyMovieClip(n, i);
c.createTextField("my_txt", 0, 0, 0, 0, 0);
with (c.my_txt) {
autoSize = "center";
text = array[i];
_y = i * c._height;
}
// iterate 'i' by one
i++;
// if 'i' is at the end of the word (last letter), then clear the 'letterID'
// interval and start the interval for the next word
if (i >= array.length) {
clearInterval(letterID);
clearInterval(wordID);
wordID = setInterval(createWord, speedBetweenWords);
}
}
// initialize the first word
createWord();
|