I am creating a hangman-type game in Flash 5. To create the letter board with all the letters of the alphabet, I made a movie clip of a letter tile with a frame for each letter. There are 26 instances of the movie clip (Letter concatenated with A, B, C, etc. in order to have the correct letter display on each tile, I created the following function:
function setupLetters () {
tellTarget (“LetterA”) {
gotoAndStop (“A”);
}
tellTarget (“LetterB”) {
gotoAndStop (“B”);
}
etc through to…
what is the point of posting in this forum if it only posts the first half of your message???
if anyone can help i’ll send the rest of the message via e-mail. BTW it’s only 546 chars long and the forum says Max is 10000 - whoever wrote this forum should learn how to do math.
Sorry - I was also upset because I came to this site by way of EZboard, who made me go through the registration process with them before they told me that this forum had moved - and then I had to register all over again when I got here… So I am sorry, and I apologise.
Now that I know how to post code… I
OK forget it - I am not posting one line of my code at a time. No really - who designed this forum?
Posting code really isn’t that hard, you just use either the php or the code VB tags.
You don’t have to go line by line, Just click the button, put in a space, hit ok, then paste your code between the tags, or you can just type out the tags yourself.
Anywho, if you decide you don’t like this forum later, then you are free to leave, we don’t chain you down and keep you here forever :bad: (or do we :q: )
Try this…
function setupLetters () {
_root.LetterA.gotoAndStop("A");
_root.LetterB.gotoAndStop("B");
_root.LetterZ.gotoAndStop("Z");
}
Something tells me there should be an easier way than 26 gotoAndStops though… :-\
Wow! Thanks. I tried the PHP button and it only lets me paste in one line of my code at a time - even if I select it all first. What gets pasted into the space ends at either the first semicolon or curly brace.
I found the problem anyway - I was trying to loop through an array of the alphabet and it would not target the movieclip. I was trying something like:
"Letter" + array*.gotoAndPlay (array*)
and although my Flash 5 Book says eval() is no longer used, you actually HAVE to use it where your target contains a variable. So I used it and problem solved!
I thstarted a game of hangman quite a while back, but never got round to finishing it. In case anyone was wondering why the French accented characters are in there, it’s because it was originally designed to teach French to children…
Mostly seems to work though.
Creating engaging and entertaining content for designers and developers since 1998.