tellTarget doesn't work inside functions?

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…

tellTarget (“LetterZ”) {
gotoAndStop (“Z”);
}

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.

Dave

thinsoapy:

you really want help bad, huh?

badmouthing the forum instead of asking why it happens is not the way to get help fast…

One reason no one is coming to the front, is because TellTarget has been depricated since Flash 5…

If you want to post code, use the php button right above the reply window, and add away…

Rev

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?

Hopefully I’ll find my answers elsewhere…

Dave

It really isn’t that tough, people post code all of the time…

It must be something you are doing…

just post your .fla, ask your question, let someone figure it out for you…

I realize you are frustrated, most are by the time they get here, but relax, you are amongst friends here.

Rev

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… :-\

Thanks Lost… :slight_smile:

Thinsoapy:

really, this is prob the best place to ask your question… and get it answered fairly quickly anyway…

Rev

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!

eval("Letter" + array*).gotoAndPlay (array*)

Thanks for being so understanding!

Dave

Glad you found the answer…

When you have another, just ask…

Rev

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.