There’s a textfield(Var: inputText), a button and MovieClips(ASCII values 32 to 126).
When you input some letters to the textfield and push the button, I wanna show you the MovieClips of letters which you just input. (you input “flash” -> push the button -> the MovieClips “f” “l” “a” “s” “h” appear.)
I wrote some scripts to the frame1 (_root.movieclips._visible = false; …) and the button(see following).
on (release) {
s = new String(_root.inputText);
if ( s.slice( 0, 1 ) == “A”) {
_root.A._visible = true;
} else if ( s.slice( 0, 1 ) == “B”) {
_root.B._visible = true;
// continue and continue and continue…
}
if ( s.slice( 1, 2 ) == “A”) {
_root.A2._visible = true;
// continue…
}
}
*the instance names of the movieclips are A, B, C, …
I know this scripts are lengthy and not great. But I couldn’t think any more. Should I use the “attachMovie” or something else? If so, how can I write the scripts briefly?
I’m a really really beginner so there must be strange points in my explanation… sorry.
Thank you for replying me lostinbeta, but no, sorry, I couldn’t explain correctly.
I wanna show you the movieclips of alphabets.
I wanna use the strange font to show you some characters but I don’t think
all of you have the same font as mine. so…
Do you understand the meaning from my explanation?
Ok, I finished a version on my end. I can’t believe I pulled this off myself!!!
I am so proud of myself…lol.
Check the attachment .fla.
You will need to go to Control/Test Movie to see it work. Of course it is generic and I just used basic letters no animations, but I was trying to whip it up real quick.
yes you should use attachMovieclip, no you should not do it that way.
first off, instead of having THAT many movieclips, just make one movieclip with frames for each letter. If you already made and named the movieclips, Im sorry. Having them in one movieclip means you dont need instance names (or to set linker IDs for attaching) for EVERY letter. All you need is that one clip and then just use a gotoAndStop to go to the letter you need it to.
Then, all you need to do is, probably on textField.onChanged is attach that clip with all the letters and add it to what letters are already there (providing the proper offset) and then tell it to goto and stop at the frame of that letter, which you could actually have in there placed based on their ASCII value, or do something like the ASCII-31 or whatever.
The only problem will be that the changing of the textfield isnt always linear, meaning someone could go back and change the first word in which case you would have to re-attach everything - so you might just want to attach everything on every onChanged.
[edit] started this before lost posted his example so I dont know if this is ‘easier’ than that or not ;)[/edit]
Hey lostinbeta! You’re genius!!
Thank you very much for your work, I really appreciate it.
And senocular, thank you for your idea.
I guess your method is great, but as I wrote before,
I’m a really beginner and I’m not sure whether I can do it
according to your method… but I’ll try at least.
Anyway thank you very much!
I think I’m happier than you lostinbeta! lol.