I am just not getting it

I’ve been trying to figure out how to match a particular movie clip to a letter when some enter it?

So, they enter there name: M E G,

for the M (which is displayed) I also want to call or load a movie clip I have of someone signing (American Sign Language) the letter M. So, they enter there name, the timeline jumps to frame 10, where I have a button I want to press that would then search out the matches to the letters and return the appropriate movieclip.

I have tried some various ways, but I’m failing miserably at them it seems.

on (press) {
if (textbox.text.indexOf(“M”) != -1) {
_root.loadMovieNum(myMovie.swf, 10);
} else {
_root.gotoAndStop(“namemissing”);
}

I know I’m probably using all this incorrectly-- any ideas???

Hi,

I’m not very advanced either but here goes for what might be wrong with your code…

if you use _root.loadMovie(“mymovie”, 10) then you are loading a movie named mymovie to level 10 of the main movie. If you want to go to frame 10 of the main movie I think you need something like _root.gotoAndStop(10);

I hope this helps you out a bit.

Liz

I was trying to load the “handshape” movie on level10 so it was on top of the underlying movie which woud sit be showing the typed name in a dynamic textbox.

I can’t seem to “get” the letter typed or cause anything special to happen becaused they typed a M as opposed to typing an A.

…meaing if my varable for inputName = M , how do I use that “M” to match something or have it evaluated so then it could load a movie or whatever is needed to be triggered??? I think that’s my question…

It’s been a long day trying to figure this out

Okay, how about something like this

d = 10; //start depth for hand movie clips
l = String(textbox.text).length;
for(i=0;i<l;i++) {
c = String(textbox.text).charAt(i);
switch© {
case “a”:
case “A”:
_root.loadMovie(“myA”, d);
break;
.
.
.
case “z”:
case “Z”:
_root.loadMovie(“myZ”, d);
break;
default
// not a letter
}
d++;
}

where you fill in the rest of the alphabet.

Liz

*Originally posted by Mikol27 *
**I’ve been trying to figure out how to match a particular movie clip to a letter when some enter it?

So, they enter there name: M E G,

for the M (which is displayed) I also want to call or load a movie clip I have of someone signing (American Sign Language) the letter M. So, they enter there name, the timeline jumps to frame 10, where I have a button I want to press that would then search out the matches to the letters and return the appropriate movieclip.

I have tried some various ways, but I’m failing miserably at them it seems.

on (press) {
if (textbox.text.indexOf(“M”) != -1) {
_root.loadMovieNum(myMovie.swf, 10);
} else {
_root.gotoAndStop(“namemissing”);
}

I know I’m probably using all this incorrectly-- any ideas??? **


on(press){
if(textbox.text = m){
_root.loadMovieNum("myMovie.swf",1); //this confuses me 1 is the level not frame of movie
}

Wild…just amazing. So the … is where I would duplicate the all the letters- cool.

Where would this code need to be, on a button, or Actions layer???

Yes, the … is where you would fill in the missing letters for the alphabet. I didn’t put a break between the lower and upper case letters so that you only need one set of code to load you letter movie regardless of whether they had the shift key down or not.

You could use it in your on(press) function that already exists.

Liz

Thank you! Thank you! I will tinker with it and see if I can get it working. I appreciate the help :slight_smile:

Your welcome :player:

Liz

I’m trying to enter this script…I was hoping to get it working for 1 letter before adding all the script to include the rest. I get the script into Flash MX without errors, but it doesn’t do anything. If you have a sec to proof read this…I appreciate it.

In need of help,

-M

Hi,

sorry it took so long to get back to you. If you post your fla I’ll look at it for you… unless you’ve already figured it out.

Liz

You’re at a much higher level of understanding than I…so don’t laugh if i’m not even in the right ball in getting this to work.

I appreciate your willingness to look at my fla and help out!!

Hi,

I have changed your code slightly so it will now load the movie clip for a or A in.

You had formed your for loop incorrectly. I put some comments around what I changed so you can see.

The only code I changed was that on the button you press to see the sign language.

I hope this helps you out.

Liz

You are one of the kindest people. Thank you so much for taking your time to review and fix the code.

You have totally made my day!!!:bounce:

No prob, and you’re welcome :thumb:

I had it…I really had it working, then I tried to make a change and it went Kaaapluweeee.

Do I need to create separate “textboxes” for each letter that will be entered? And add to the actionscript to include each of those textboxes with the same process? As you can see (fla attached) I was starting down that path, but I wasn’t sure I really needed to that. Where i have the Flash movie to now is that you type in your name “Mikol” - it displays it fine, but it is only loading the movie that correspondes with the last letter of the input string.

I know it’s close to working cause I had it at one point, but now I’m frustrated because I can’t get it back.

Would mind looking at it one more time for me? Thanks a million.

Hi,

Not to take anything away from Liz but here’s my version of doing the same.

I used MC’s instead of external swf’s. But i did detail in frame 1 of the root timeline how to change the code to use external swf’s.

Although i havent tested it.

Regards,
Viru.

Thanks for the help. I tried to change the code to use the external .swf’s but so far I can’t get it to do anything. I’m fiddling with though to what I can shake lose.

I almost have Liz’s code with a few modification working, but inputing the name is kinda clumsy (the only way i could figure out to do mulitple letters) with each letter going into a separate textbox.

I’m cleaning it up a little then i’ll stick it out on my test site to demonstrate.

-M

Well if you give me the URLs to your letters SWFs then i can have a go at making it work properly.

Regards,
Viru.