Thursday, March 15, 2007

Hangman Code

function makePhrases():Void {
_root.myPhrases = new Array();
myPhrases[0] = "To hell and back";
myPhrases[1] = "There is no God but Allah";
myPhrases[2] = "There's the rub";
myPhrases[3] = "Tank the game, rules";
myPhrases[4] = "God, this sucks";
}
makePhrases();
function generateRandomPhrase():Number {
var phraseToUse = Math.floor(Math.random()*myPhrases.length);
return phraseToUse;
}
var myPhraseToUse = generateRandomPhrase();
trace(myPhraseToUse);
function makeBoxes():Void {
var letterSpotX:Number = 25;
var letterSpotY:Number = 100;
for (var i:Number = 0; i
_root.attachMovie("letterMC", "letter_"+i, i, {_x:letterSpotX, _y:letterSpotY});
_root["letter_"+i].letterBox.text = myPhrases[myPhraseToUse].charAt(i);
letterSpotX += 25;
}
}
makeBoxes();

Monday, March 5, 2007

Slide and Text Outline for 2/27 and 3/1

Sorry I took so long to post them. You download them from the area on the left, as always.


About the CTVA 468 Blog

This blog is meant for students enrolled in CSUN's CTVA 468 class (Advanced Multimedia), devoted to programming with Flash.